string_to_decimal(3C) Standard C Library Functions string_to_decimal(3C)
NAME
string_to_decimal, file_to_decimal, func_to_decimal - parse characters into decimal record
SYNOPSIS
#include <floatingpoint.h>
void string_to_decimal(char **pc, int nmax, int fortran_conventions, decimal_record *pd, enum decimal_string_form *pform, char **pechar);
void func_to_decimal(char **pc, int nmax, int fortran_conventions, decimal_record *pd, enum decimal_string_form *pform, char **pechar, int
(*pget)(void), int *pnread, int (*punget)(int c));
#include <stdio.h>
void file_to_decimal(char **pc, int nmax, int fortran_conventions, decimal_record *pd, enum decimal_string_form *pform, char **pechar, FILE
*pf, int *pnread);
DESCRIPTION
These functions attempt to parse a numeric token from at most nmax characters read from a string **pc, a file *pf, or function (*pget)().
They set the decimal record *pd to reflect the value of the numeric token recognized and set *pform and *pechar to indicate its form.
The accepted forms for the numeric token consist of an initial, possibly empty, sequence of white-space characters, as defined by iss-
pace(3C), followed by a subject sequence representing a numeric value, infinity, or NaN. The subject sequence consists of an optional plus
or minus sign followed by one of the following:
o a non-empty sequence of decimal digits optionally containing a decimal point character, then an optional exponent part
o one of INF or INFINITY, ignoring case
o one of NAN or NAN(string), ignoring case in the NAN part; string can be any sequence of characters not containing ')' (right parenthe-
sis) or '