diff options
author | martynas <> | 2008-09-13 22:48:45 +0000 |
---|---|---|
committer | martynas <> | 2008-09-13 22:48:45 +0000 |
commit | 404f42e023f74f798d3e32269dc691e855f21e4c (patch) | |
tree | dfea5495a34ac92b7fe984aa58d91a942486c3fa | |
parent | 6a07d35d454e3b3e1263e40935ee70899dbeb92f (diff) | |
download | openbsd-404f42e023f74f798d3e32269dc691e855f21e4c.tar.gz openbsd-404f42e023f74f798d3e32269dc691e855f21e4c.tar.bz2 openbsd-404f42e023f74f798d3e32269dc691e855f21e4c.zip |
document strtold. ok millert@
-rw-r--r-- | src/lib/libc/stdlib/Makefile.inc | 4 | ||||
-rw-r--r-- | src/lib/libc/stdlib/strtod.3 | 32 |
2 files changed, 25 insertions, 11 deletions
diff --git a/src/lib/libc/stdlib/Makefile.inc b/src/lib/libc/stdlib/Makefile.inc index ab8bd39f07..c149aeef0a 100644 --- a/src/lib/libc/stdlib/Makefile.inc +++ b/src/lib/libc/stdlib/Makefile.inc | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile.inc,v 1.40 2008/09/07 20:36:08 martynas Exp $ | 1 | # $OpenBSD: Makefile.inc,v 1.41 2008/09/13 22:48:45 martynas Exp $ |
2 | 2 | ||
3 | # stdlib sources | 3 | # stdlib sources |
4 | .PATH: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/stdlib ${LIBCSRCDIR}/stdlib | 4 | .PATH: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/stdlib ${LIBCSRCDIR}/stdlib |
@@ -64,7 +64,7 @@ MLINKS+=random.3 srandom.3 random.3 srandomdev.3 | |||
64 | MLINKS+=rand48.3 drand48.3 rand48.3 erand48.3 rand48.3 lrand48.3 | 64 | MLINKS+=rand48.3 drand48.3 rand48.3 erand48.3 rand48.3 lrand48.3 |
65 | MLINKS+=rand48.3 mrand48.3 rand48.3 nrand48.3 rand48.3 jrand48.3 | 65 | MLINKS+=rand48.3 mrand48.3 rand48.3 nrand48.3 rand48.3 jrand48.3 |
66 | MLINKS+=rand48.3 srand48.3 rand48.3 seed48.3 rand48.3 lcong48.3 | 66 | MLINKS+=rand48.3 srand48.3 rand48.3 seed48.3 rand48.3 lcong48.3 |
67 | MLINKS+=strtod.3 strtof.3 | 67 | MLINKS+=strtod.3 strtof.3 strtod.3 strtold.3 |
68 | MLINKS+=strtol.3 strtoll.3 strtol.3 strtoq.3 strtol.3 strtoimax.3 | 68 | MLINKS+=strtol.3 strtoll.3 strtol.3 strtoq.3 strtol.3 strtoimax.3 |
69 | MLINKS+=strtoul.3 strtoull.3 strtoul.3 strtouq.3 strtoul.3 strtoumax.3 | 69 | MLINKS+=strtoul.3 strtoull.3 strtoul.3 strtouq.3 strtoul.3 strtoumax.3 |
70 | MLINKS+=tsearch.3 tfind.3 | 70 | MLINKS+=tsearch.3 tfind.3 |
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 . |