Indentation fix, cleanup.
[AROS.git] / compiler / stdc / strtold.c
bloba4ee6220b832e379a5f89c9eaec7e29d6baa9a12
1 /*
2 Copyright © 2015, The AROS Development Team. All rights reserved.
3 $Id$
5 C99 function strtold().
6 */
8 #ifndef AROS_NOFPU
10 #include <ctype.h>
11 #include <limits.h>
13 /*****************************************************************************
15 NAME */
16 #include <stdlib.h>
17 #include <math.h>
19 long double strtold (
21 /* SYNOPSIS */
22 const char * str,
23 char ** endptr)
25 /* FUNCTION
26 Convert a string of digits into a long double.
28 INPUTS
29 str - The string which should be converted. Leading
30 whitespace are ignored. The number may be prefixed
31 by a '+' or '-'. An 'e' or 'E' introduces the exponent.
32 Komma is only allowed before exponent.
33 endptr - If this is non-NULL, then the address of the first
34 character after the number in the string is stored
35 here.
37 RESULT
38 The value of the string. The first character after the number
39 is returned in *endptr, if endptr is non-NULL. If no digits can
40 be converted, *endptr contains str (if non-NULL) and 0 is
41 returned.
43 NOTES
44 We make the compiler do an internal conversion from a double
45 to a long double. Because of this we lose a some precision, but for
46 now it works.
48 EXAMPLE
50 BUGS
51 NAN is not handled at the moment
53 SEE ALSO
54 strtod()
56 INTERNALS
58 ******************************************************************************/
60 return (long double)strtod(str, endptr);
61 } /* strtold */
63 #else
65 void strtold (const char * str,char ** endptr)
67 return;
70 #endif /* AROS_NOFPU */