numpy  2.0.0
src/multiarray/numpyos.h File Reference

Go to the source code of this file.

Functions

NPY_NO_EXPORT char * NumPyOS_ascii_formatd (char *buffer, size_t buf_size, const char *format, double val, int decimal)
NPY_NO_EXPORT char * NumPyOS_ascii_formatf (char *buffer, size_t buf_size, const char *format, float val, int decimal)
NPY_NO_EXPORT char * NumPyOS_ascii_formatl (char *buffer, size_t buf_size, const char *format, long double val, int decimal)
NPY_NO_EXPORT double NumPyOS_ascii_strtod (const char *s, char **endptr)
NPY_NO_EXPORT long double NumPyOS_ascii_strtold (const char *s, char **endptr)
NPY_NO_EXPORT int NumPyOS_ascii_ftolf (FILE *fp, double *value)
NPY_NO_EXPORT int NumPyOS_ascii_ftoLf (FILE *fp, long double *value)
NPY_NO_EXPORT int NumPyOS_ascii_isspace (int c)

Function Documentation

NPY_NO_EXPORT char* NumPyOS_ascii_formatd ( char *  buffer,
size_t  buf_size,
const char *  format,
double  val,
int  decimal 
)
NPY_NO_EXPORT char* NumPyOS_ascii_formatf ( char *  buffer,
size_t  buf_size,
const char *  format,
float  val,
int  decimal 
)
NPY_NO_EXPORT char* NumPyOS_ascii_formatl ( char *  buffer,
size_t  buf_size,
const char *  format,
long double  val,
int  decimal 
)
NPY_NO_EXPORT int NumPyOS_ascii_ftolf ( FILE *  fp,
double *  value 
)
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.

Referenced by TOTYPE().

NPY_NO_EXPORT int NumPyOS_ascii_ftoLf ( FILE *  fp,
long double *  value 
)
NumPyOS_ascii_isspace:
Same as isspace under C locale

References c.

Referenced by NumPyOS_ascii_strncasecmp().

NPY_NO_EXPORT double NumPyOS_ascii_strtod ( const char *  s,
char **  endptr 
)
NumPyOS_ascii_strtod:
Work around bugs in PyOS_ascii_strtod
##1
Recognize POSIX inf/nan representations on all platforms.
End of ##1
## 2
At least Python versions <= 2.6.8
Fails to do best-efforts parsing of strings of the form "1<DP>234" where <DP> is the decimal point under the foreign locale. This is because PyOS_ascii_strtod is buggy, and will completely refuse to parse the string, rather than parsing the first part "1".
End of ##2
NPY_NO_EXPORT long double NumPyOS_ascii_strtold ( const char *  s,
char **  endptr 
)
##1
Recognize POSIX inf/nan representations on all platforms.
End of ##1