pystrtod.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef Py_STRTOD_H
  2. #define Py_STRTOD_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. PyAPI_FUNC(double) PyOS_string_to_double(const char *str,
  7. char **endptr,
  8. PyObject *overflow_exception);
  9. /* The caller is responsible for calling PyMem_Free to free the buffer
  10. that's is returned. */
  11. PyAPI_FUNC(char *) PyOS_double_to_string(double val,
  12. char format_code,
  13. int precision,
  14. int flags,
  15. int *type);
  16. #ifndef Py_LIMITED_API
  17. PyAPI_FUNC(double) _Py_parse_inf_or_nan(const char *p, char **endptr);
  18. #endif
  19. /* PyOS_double_to_string's "flags" parameter can be set to 0 or more of: */
  20. #define Py_DTSF_SIGN 0x01 /* always add the sign */
  21. #define Py_DTSF_ADD_DOT_0 0x02 /* if the result is an integer add ".0" */
  22. #define Py_DTSF_ALT 0x04 /* "alternate" formatting. it's format_code
  23. specific */
  24. /* PyOS_double_to_string's "type", if non-NULL, will be set to one of: */
  25. #define Py_DTST_FINITE 0
  26. #define Py_DTST_INFINITE 1
  27. #define Py_DTST_NAN 2
  28. #ifdef __cplusplus
  29. }
  30. #endif
  31. #endif /* !Py_STRTOD_H */