diff options
author | Martynas Venckus <martynas@cvs.openbsd.org> | 2011-07-08 22:48:20 +0000 |
---|---|---|
committer | Martynas Venckus <martynas@cvs.openbsd.org> | 2011-07-08 22:48:20 +0000 |
commit | 55dda7e1d1917aeab06bac8c4ec7b9c22a8dbd3a (patch) | |
tree | e0ea321097ec0de6130dfc26fe05a99f0c93f01c | |
parent | e219a60c57612cb211779fb7c42843dc3baed1a1 (diff) |
Alias modfl to modf. This goes together with the previous bump.
-rw-r--r-- | lib/libc/gen/modf.3 | 16 | ||||
-rw-r--r-- | lib/libc/gen/modf.c | 14 |
2 files changed, 25 insertions, 5 deletions
diff --git a/lib/libc/gen/modf.3 b/lib/libc/gen/modf.3 index aa5434b5d17..92d39502ec7 100644 --- a/lib/libc/gen/modf.3 +++ b/lib/libc/gen/modf.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: modf.3,v 1.10 2011/07/08 22:28:33 martynas Exp $ +.\" $OpenBSD: modf.3,v 1.11 2011/07/08 22:48:19 martynas Exp $ .\" .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -36,7 +36,8 @@ .Os .Sh NAME .Nm modf , -.Nm modff +.Nm modff , +.Nm modfl .Nd extract signed integral and fractional values from floating-point number .Sh SYNOPSIS .Fd #include <math.h> @@ -44,6 +45,8 @@ .Fn modf "double value" "double *iptr" .Ft float .Fn modff "float value" "float *iptr" +.Ft long double +.Fn modfl "long double value" "long double *iptr" .Sh DESCRIPTION The .Fn modf @@ -59,11 +62,16 @@ The .Fn modff function is a single precision version of .Fn modf . +The +.Fn modfl +function is an extended precision version of +.Fn modf . .Sh RETURN VALUES The -.Fn modf -and +.Fn modf , .Fn modff +and +.Fn modfl functions return the signed fractional part of .Fa value . .Sh SEE ALSO diff --git a/lib/libc/gen/modf.c b/lib/libc/gen/modf.c index 24effd38045..fde7cd82bab 100644 --- a/lib/libc/gen/modf.c +++ b/lib/libc/gen/modf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: modf.c,v 1.3 2011/07/08 22:28:33 martynas Exp $ */ +/* $OpenBSD: modf.c,v 1.4 2011/07/08 22:48:19 martynas Exp $ */ /* $NetBSD: modf.c,v 1.1 1995/02/10 17:50:25 cgd Exp $ */ /* @@ -28,9 +28,12 @@ * rights to redistribute these changes. */ +/* LINTLIBRARY */ + #include <sys/types.h> #include <machine/ieee.h> #include <errno.h> +#include <float.h> #include <math.h> /* @@ -102,3 +105,12 @@ modf(double val, double *iptr) u.s.dbl_sign = v.s.dbl_sign; return (u.v); } + +#if LDBL_MANT_DIG == 53 +#ifdef lint +/* PROTOLIB1 */ +long double frexpl(long double, int *); +#else /* lint */ +__weak_alias(modfl, modf); +#endif /* lint */ +#endif /* LDBL_MANT_DIG == 53 */ |