#include "c.h"
#include <float.h>
#include <math.h>
Go to the source code of this file.
|
float | pg_strtof (const char *nptr, char **endptr) |
|
◆ pg_strtof()
float pg_strtof |
( |
const char * |
nptr, |
|
|
char ** |
endptr |
|
) |
| |
Definition at line 30 of file strtof.c.
32 int caller_errno = errno;
36 fresult = (strtof) (nptr, endptr);
42 else if ((*endptr == nptr) || isnan(fresult) ||
43 ((fresult >= FLT_MIN || fresult <= -FLT_MIN) && !isinf(fresult)))
58 double dresult = strtod(nptr, NULL);
65 else if ((dresult == 0.0 && fresult == 0.0) ||
66 (isinf(dresult) && isinf(fresult) && (fresult == dresult)))
72 else if ((dresult > 0 && dresult <= FLT_MIN && (
float) dresult != 0.0) ||
73 (dresult < 0 && dresult >= -FLT_MIN && (
float) dresult != 0.0))
77 return (
float) dresult;