diff options
Diffstat (limited to 'src/lib/libc/stdlib/strtod.3')
-rw-r--r-- | src/lib/libc/stdlib/strtod.3 | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/src/lib/libc/stdlib/strtod.3 b/src/lib/libc/stdlib/strtod.3 index 5f97639d8d..f1fc781f7d 100644 --- a/src/lib/libc/stdlib/strtod.3 +++ b/src/lib/libc/stdlib/strtod.3 | |||
@@ -29,17 +29,18 @@ | |||
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
30 | .\" SUCH DAMAGE. | 30 | .\" SUCH DAMAGE. |
31 | .\" | 31 | .\" |
32 | .\" $OpenBSD: strtod.3,v 1.13 2008/09/13 22:25:49 martynas Exp $ | 32 | .\" $OpenBSD: strtod.3,v 1.14 2008/09/13 22:48:45 martynas Exp $ |
33 | .\" | 33 | .\" |
34 | .Dd $Mdocdate: September 13 2008 $ | 34 | .Dd $Mdocdate: September 13 2008 $ |
35 | .Dt STRTOD 3 | 35 | .Dt STRTOD 3 |
36 | .Os | 36 | .Os |
37 | .Sh NAME | 37 | .Sh NAME |
38 | .Nm strtod , | 38 | .Nm strtod , |
39 | .Nm strtof | 39 | .Nm strtof , |
40 | .Nm strtold | ||
40 | .Nd convert | 41 | .Nd convert |
41 | .Tn ASCII | 42 | .Tn ASCII |
42 | string to double or float | 43 | string to double, float or long double |
43 | .Sh SYNOPSIS | 44 | .Sh SYNOPSIS |
44 | .Fd #include <math.h> | 45 | .Fd #include <math.h> |
45 | .Fd #include <stdlib.h> | 46 | .Fd #include <stdlib.h> |
@@ -48,6 +49,9 @@ string to double or float | |||
48 | .Pp | 49 | .Pp |
49 | .Ft float | 50 | .Ft float |
50 | .Fn strtof "const char *nptr" "char **endptr" | 51 | .Fn strtof "const char *nptr" "char **endptr" |
52 | .Pp | ||
53 | .Ft long double | ||
54 | .Fn strtold "const char *nptr" "char **endptr" | ||
51 | .Sh DESCRIPTION | 55 | .Sh DESCRIPTION |
52 | The | 56 | The |
53 | .Fn strtod | 57 | .Fn strtod |
@@ -63,6 +67,13 @@ function converts the initial portion of the string pointed to by | |||
63 | to | 67 | to |
64 | .Li float | 68 | .Li float |
65 | representation. | 69 | representation. |
70 | The | ||
71 | .Fn strtold | ||
72 | function converts the initial portion of the string pointed to by | ||
73 | .Fa nptr | ||
74 | to | ||
75 | .Li long double | ||
76 | representation. | ||
66 | .Pp | 77 | .Pp |
67 | The expected form of the string is an optional plus | 78 | The expected form of the string is an optional plus |
68 | .Pq Ql + | 79 | .Pq Ql + |
@@ -81,9 +92,10 @@ Leading whitespace characters in the string (as defined by the | |||
81 | function) are skipped. | 92 | function) are skipped. |
82 | .Sh RETURN VALUES | 93 | .Sh RETURN VALUES |
83 | The | 94 | The |
84 | .Fn strtod | 95 | .Fn strtod , |
85 | and | ||
86 | .Fn strtof | 96 | .Fn strtof |
97 | and | ||
98 | .Fn strtold | ||
87 | functions return the converted value, if any. | 99 | functions return the converted value, if any. |
88 | .Pp | 100 | .Pp |
89 | If | 101 | If |
@@ -123,9 +135,11 @@ Overflow or underflow occurred. | |||
123 | .Sh STANDARDS | 135 | .Sh STANDARDS |
124 | The | 136 | The |
125 | .Fn strtod | 137 | .Fn strtod |
126 | function conform to | 138 | function conforms to |
127 | .St -ansiC-89 | 139 | .St -ansiC-89 . |
128 | and | 140 | The |
129 | .Fn strtof | 141 | .Fn strtof |
130 | conform to | 142 | and |
143 | .Fn strtold | ||
144 | functions conform to | ||
131 | .St -ansiC-99 . | 145 | .St -ansiC-99 . |