This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: underflow exceptions


On Thu, 24 May 2012, David Miller wrote:

> Failure: exp2 (-16400) == 0x1p-16400: Exception "Underflow" set

The IEEE 754 rule is that *exact* underflow cases don't raise the 
exception flag, only inexact ones, and exp2 ought to be able to handle 
exact cases properly.  exp2l is calling __scalbnl so maybe that's getting 
something wrong.

> Failure: scalbn (min_value / 4, INT_MAX) == inf: Exception "Underflow" set
> Failure: scalbln (min_value / 4, INT_MAX) == inf: Exception "Underflow" set
> Failure: scalbln (min_value / 4, LONG_MAX) == inf: Exception "Underflow" set
> Failure: scalbln (min_value / 4, 0x88000000) == inf: Exception "Underflow" set

These are all overflow cases, not underflow, and certainly should not 
raise the underflow exception.

One possibility that occurs to me is that the exception is occurring in 
the "min_value / 4" computation rather than in the function being called.  
If so, that would be a bug in soft-fp; min_value / 4 is exact so should 
not raise the underflow exception.

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]