public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] libm/math: ensure that expf(-huge) sets FE_UNDERFLOW exception
@ 2020-08-08  5:40 Keith Packard
  2020-08-10  9:30 ` Corinna Vinschen
  0 siblings, 1 reply; 2+ messages in thread
From: Keith Packard @ 2020-08-08  5:40 UTC (permalink / raw)
  To: newlib

It was calling __math_uflow(0) instead of __math_uflowf(0), which
resulted in no exception being set on machines with exception support
for float but not double.

Signed-off-by: Keith Packard <keithp@keithp.com>
---
 newlib/libm/math/ef_exp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/newlib/libm/math/ef_exp.c b/newlib/libm/math/ef_exp.c
index 0cd0c00b3..d6e25bfcd 100644
--- a/newlib/libm/math/ef_exp.c
+++ b/newlib/libm/math/ef_exp.c
@@ -64,7 +64,7 @@ P5   =  4.1381369442e-08; /* 0x3331bb4c */
 	if(sx > FLT_UWORD_LOG_MAX)
 	    return __math_oflowf(0); /* overflow */
 	if(sx < 0 && hx > FLT_UWORD_LOG_MIN)
-	    return __math_uflow(0); /* underflow */
+	    return __math_uflowf(0); /* underflow */
 	
     /* argument reduction */
 	if(hx > 0x3eb17218) {		/* if  |x| > 0.5 ln2 */ 
-- 
2.28.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] libm/math: ensure that expf(-huge) sets FE_UNDERFLOW exception
  2020-08-08  5:40 [PATCH] libm/math: ensure that expf(-huge) sets FE_UNDERFLOW exception Keith Packard
@ 2020-08-10  9:30 ` Corinna Vinschen
  0 siblings, 0 replies; 2+ messages in thread
From: Corinna Vinschen @ 2020-08-10  9:30 UTC (permalink / raw)
  To: newlib

On Aug  7 22:40, Keith Packard via Newlib wrote:
> It was calling __math_uflow(0) instead of __math_uflowf(0), which
> resulted in no exception being set on machines with exception support
> for float but not double.
> 
> Signed-off-by: Keith Packard <keithp@keithp.com>
> ---
>  newlib/libm/math/ef_exp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/newlib/libm/math/ef_exp.c b/newlib/libm/math/ef_exp.c
> index 0cd0c00b3..d6e25bfcd 100644
> --- a/newlib/libm/math/ef_exp.c
> +++ b/newlib/libm/math/ef_exp.c
> @@ -64,7 +64,7 @@ P5   =  4.1381369442e-08; /* 0x3331bb4c */
>  	if(sx > FLT_UWORD_LOG_MAX)
>  	    return __math_oflowf(0); /* overflow */
>  	if(sx < 0 && hx > FLT_UWORD_LOG_MIN)
> -	    return __math_uflow(0); /* underflow */
> +	    return __math_uflowf(0); /* underflow */
>  	
>      /* argument reduction */
>  	if(hx > 0x3eb17218) {		/* if  |x| > 0.5 ln2 */ 
> -- 
> 2.28.0

Pushed.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-10  9:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-08  5:40 [PATCH] libm/math: ensure that expf(-huge) sets FE_UNDERFLOW exception Keith Packard
2020-08-10  9:30 ` 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).