- NumPyOS_ascii_ftolf:
-
fp: FILE pointer
-
value: Place to store the value read
Similar to PyOS_ascii_strtod, except that it reads input from a file.
Similarly to fscanf, this function always consumes leading whitespace, and any text that could be the leading part in valid input.
- Return value: similar to fscanf.
-
0 if no number read,
-
1 if a number read,
-
EOF if end-of-file met before reading anything.
Pass on to PyOS_ascii_strtod the leftmost matching part in regexp <blockquote>
- s*[+-]? ( [0-9]*.[0-9]+([eE][+-]?[0-9]+)
nan ( ([:alphanum:_]*) )?
inf(inity)?
System Message: WARNING/2 (<string>
, line 5) Line block ends without a blank line.
)
</blockquote>
case-insensitively.
The "do { ... } while (0)" wrapping in macros ensures that they behave properly eg. in "if ... else" structures.
-
emulate fscanf EOF handling
-
consume leading whitespace unconditionally
-
start reading matching input to buffer
4.1 sign (optional)
4.2 nan, inf, infinity; [case-insensitive]
accept nan([:alphanum:_]*), similarly to strtod
4.3 mantissa
4.4 exponent
return 1 if something read, else 0