NetBSD-Users archive

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

Re: NetBSD math asinf() Issue

In article 
Channa  <> wrote:
>I am using math library from NetBSD libraries.
>I faced some issue while using the API asinf().
>asinf() does not return proper values for some inputs
>The following is the test code to reproduce the issue:
>$ cat asinf_test.c
>#include <math.h>
>#include <float.h>
>#include <stdio.h>
>#include <stdint.h>
>#ifndef NAN
>#define NAN (0.0f/0.0f)
>#ifndef INF
>#define INF (1.0f/0.0f)
>int main()
>float result = asinf(0x1.fffffep+127F);
>float expected = NAN;
> * Result is expected to be NAN for the above
> * input
> */
>printf("Returned :%.8eF, expected: %.8eF\n",result,expected);
>return 0;
>$ ./asinf_test
>Returned :0.00000000e+00F, expected: nanF
>Is this a bug with the respect to asinf() ?
>Please help me in this regard.
>Awaiting for reply.

The code seems to be DTRT'ing. it runs 'return (x-x)/(x-x);' but ends up with
0. I did not see anything wrong in the assembly code either. Strange.


Home | Main Index | Thread Index | Old Index