Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libm/noieee_src Add fmodf and fmodl



details:   https://anonhg.NetBSD.org/src/rev/90c487028e80
branches:  trunk
changeset: 791492:90c487028e80
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Nov 21 10:48:11 2013 +0000

description:
Add fmodf and fmodl

diffstat:

 lib/libm/noieee_src/n_fmod.c |  15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diffs (36 lines):

diff -r ea57cf87be99 -r 90c487028e80 lib/libm/noieee_src/n_fmod.c
--- a/lib/libm/noieee_src/n_fmod.c      Thu Nov 21 09:40:19 2013 +0000
+++ b/lib/libm/noieee_src/n_fmod.c      Thu Nov 21 10:48:11 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: n_fmod.c,v 1.5 2003/08/07 16:44:51 agc Exp $   */
+/*     $NetBSD: n_fmod.c,v 1.6 2013/11/21 10:48:11 martin Exp $        */
 /*
  * Copyright (c) 1989, 1993
  *     The Regents of the University of California.  All rights reserved.
@@ -66,6 +66,13 @@
 extern int isnan(),finite();
 #endif /* !defined(__vax__) && !defined(tahoe) */
 
+#if DBL_MANT_DIG == LDBL_MANT_DIG && DBL_MIN_EXP == LDBL_MIN_EXP \
+        && DBL_MIN_EXP == LDBL_MIN_EXP
+#ifdef __weak_alias
+__weak_alias(fmodl, fmod);
+#endif
+#endif
+
 #ifdef TEST_FMOD
 static double
 _fmod(double x, double y)
@@ -95,6 +102,12 @@
        return x >= (double)0 ? r : -r;
 }
 
+float
+fmodf(float x)
+{
+       return fmod(x);
+}
+
 #ifdef TEST_FMOD
 extern long random();
 extern double fmod();



Home | Main Index | Thread Index | Old Index