public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Use nanf() instead of nan() in single-precision float libm math functions
@ 2019-01-23 9:53 Corinna Vinschen
0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2019-01-23 9:53 UTC (permalink / raw)
To: newlib-cvs
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=b644774b8f796d58ff9ac71af2c6aa0fa1cbcaf9
commit b644774b8f796d58ff9ac71af2c6aa0fa1cbcaf9
Author: Jozef Lawrynowicz <jozef.l@mittosystems.com>
Date: Tue Jan 22 10:40:18 2019 +0000
Use nanf() instead of nan() in single-precision float libm math functions
This patch reduces code size for a few single-precision float math
functions, by using nanf() instead of nan() where required.
Diff:
---
newlib/libm/math/wf_acos.c | 2 +-
newlib/libm/math/wf_asin.c | 2 +-
newlib/libm/math/wf_log.c | 2 +-
newlib/libm/math/wf_log10.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/newlib/libm/math/wf_acos.c b/newlib/libm/math/wf_acos.c
index 15d8699..c24912d 100644
--- a/newlib/libm/math/wf_acos.c
+++ b/newlib/libm/math/wf_acos.c
@@ -31,7 +31,7 @@
if(fabsf(x)>1.0f) {
/* acosf(|x|>1) */
errno = EDOM;
- return (float) nan("");
+ return nanf("");
} else
return z;
#endif
diff --git a/newlib/libm/math/wf_asin.c b/newlib/libm/math/wf_asin.c
index 2f9ffaf..c9f15e3 100644
--- a/newlib/libm/math/wf_asin.c
+++ b/newlib/libm/math/wf_asin.c
@@ -38,7 +38,7 @@
if(fabsf(x)>1.0f) {
/* asinf(|x|>1) */
errno = EDOM;
- return (float)nan("");
+ return nanf("");
} else
return z;
#endif
diff --git a/newlib/libm/math/wf_log.c b/newlib/libm/math/wf_log.c
index 93d1d21..97f4a7f 100644
--- a/newlib/libm/math/wf_log.c
+++ b/newlib/libm/math/wf_log.c
@@ -41,7 +41,7 @@
} else {
/* logf(x<0) */
errno = EDOM;
- return nan("");
+ return nanf("");
}
#endif
}
diff --git a/newlib/libm/math/wf_log10.c b/newlib/libm/math/wf_log10.c
index c9f8ecb..529ed65 100644
--- a/newlib/libm/math/wf_log10.c
+++ b/newlib/libm/math/wf_log10.c
@@ -41,7 +41,7 @@
} else {
/* log10f(x<0) */
errno = EDOM;
- return nan("");
+ return nanf("");
}
} else
return z;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-01-23 9:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-23 9:53 [newlib-cygwin] Use nanf() instead of nan() in single-precision float libm math functions Corinna Vinschen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).