summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorMartynas Venckus <martynas@cvs.openbsd.org>2008-09-13 22:48:46 +0000
committerMartynas Venckus <martynas@cvs.openbsd.org>2008-09-13 22:48:46 +0000
commitd2567376648580c200c258781c9ccc9d0b27009d (patch)
tree4f979b2eaaf22b330069ac6e95dfe18455b2987f /lib/libc
parent39cd6e35667b0c1542ad7858e19f2ebea2308a7d (diff)
document strtold. ok millert@
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/stdlib/Makefile.inc4
-rw-r--r--lib/libc/stdlib/strtod.332
2 files changed, 25 insertions, 11 deletions
diff --git a/lib/libc/stdlib/Makefile.inc b/lib/libc/stdlib/Makefile.inc
index ab8bd39f07b..c149aeef0a1 100644
--- a/lib/libc/stdlib/Makefile.inc
+++ b/lib/libc/stdlib/Makefile.inc
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.inc,v 1.40 2008/09/07 20:36:08 martynas Exp $
+# $OpenBSD: Makefile.inc,v 1.41 2008/09/13 22:48:45 martynas Exp $
# stdlib sources
.PATH: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/stdlib ${LIBCSRCDIR}/stdlib
@@ -64,7 +64,7 @@ MLINKS+=random.3 srandom.3 random.3 srandomdev.3
MLINKS+=rand48.3 drand48.3 rand48.3 erand48.3 rand48.3 lrand48.3
MLINKS+=rand48.3 mrand48.3 rand48.3 nrand48.3 rand48.3 jrand48.3
MLINKS+=rand48.3 srand48.3 rand48.3 seed48.3 rand48.3 lcong48.3
-MLINKS+=strtod.3 strtof.3
+MLINKS+=strtod.3 strtof.3 strtod.3 strtold.3
MLINKS+=strtol.3 strtoll.3 strtol.3 strtoq.3 strtol.3 strtoimax.3
MLINKS+=strtoul.3 strtoull.3 strtoul.3 strtouq.3 strtoul.3 strtoumax.3
MLINKS+=tsearch.3 tfind.3
diff --git a/lib/libc/stdlib/strtod.3 b/lib/libc/stdlib/strtod.3
index 5f97639d8d9..f1fc781f7df 100644
--- a/lib/libc/stdlib/strtod.3
+++ b/lib/libc/stdlib/strtod.3
@@ -29,17 +29,18 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: strtod.3,v 1.13 2008/09/13 22:25:49 martynas Exp $
+.\" $OpenBSD: strtod.3,v 1.14 2008/09/13 22:48:45 martynas Exp $
.\"
.Dd $Mdocdate: September 13 2008 $
.Dt STRTOD 3
.Os
.Sh NAME
.Nm strtod ,
-.Nm strtof
+.Nm strtof ,
+.Nm strtold
.Nd convert
.Tn ASCII
-string to double or float
+string to double, float or long double
.Sh SYNOPSIS
.Fd #include <math.h>
.Fd #include <stdlib.h>
@@ -48,6 +49,9 @@ string to double or float
.Pp
.Ft float
.Fn strtof "const char *nptr" "char **endptr"
+.Pp
+.Ft long double
+.Fn strtold "const char *nptr" "char **endptr"
.Sh DESCRIPTION
The
.Fn strtod
@@ -63,6 +67,13 @@ function converts the initial portion of the string pointed to by
to
.Li float
representation.
+The
+.Fn strtold
+function converts the initial portion of the string pointed to by
+.Fa nptr
+to
+.Li long double
+representation.
.Pp
The expected form of the string is an optional plus
.Pq Ql +
@@ -81,9 +92,10 @@ Leading whitespace characters in the string (as defined by the
function) are skipped.
.Sh RETURN VALUES
The
-.Fn strtod
-and
+.Fn strtod ,
.Fn strtof
+and
+.Fn strtold
functions return the converted value, if any.
.Pp
If
@@ -123,9 +135,11 @@ Overflow or underflow occurred.
.Sh STANDARDS
The
.Fn strtod
-function conform to
-.St -ansiC-89
-and
+function conforms to
+.St -ansiC-89 .
+The
.Fn strtof
-conform to
+and
+.Fn strtold
+functions conform to
.St -ansiC-99 .