[PATCH v4] Add nextup and nextdown math functions
Joseph Myers
joseph@codesourcery.com
Wed Jun 15 22:42:00 GMT 2016
On Wed, 15 Jun 2016, Rajalakshmi Srinivasaraghavan wrote:
> On 06/14/2016 07:59 PM, Joseph Myers wrote:
> > On Tue, 14 Jun 2016, Rajalakshmi Srinivasaraghavan wrote:
> >
> > > +#if TEST_COND_m68k96
> > > + TEST_ff_f (nextafter, -0x0.fffffffep-16383L, 0.0L,
> > > -0x3.fffffff7fffffff0p-16385L,
> > > INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_ERANGE),
> > > #endif
> > I think the test you have there is wrong for m68k96. For intel96, the
> > smallest normal exponent is -16382; for m68k96, the smallest normal
> > exponent is -16383. This input has exponent -16384. So for m68k96 it's a
> > 63-bit mantissa. The input has bits <31 1s><32 0s>. So the correct
> > output has bits <30 1s><0><32 1s>. But your output has bits <30 1s><0><31
> > 1s>. That is, the final digit in your output should be 8, not 0.
> >
> > In general, it seems very confusing in such tests to show the exponent
> > differently in the output from the input. Why do you show the input with
> > exponent -16383 but the output with exponent -16385? That applies to
> > other tests in this patch as well.
> >
> >
> Addressed comments in the attached patch.
> +#if TEST_COND_m68k96
> + TEST_ff_f (nextafter, -0x0.fffffffep-16383L, 0.0L, -0x0.fffffffdfffffffcp-16383L, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_ERANGE),
> #endif
I think this test is still wrong, and that the final digit of the result
should be 'e' not 'c', as in the intel96 test (the exponents in the tests
differ by 1, corresponding to the difference between the formats, so both
involve 63-bit mantissas.)
Likewise for the copies in the nextup and nextdown tests.
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list