NetBSD-Users archive

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

Re: NetBSD math asinf() Issue



In article 
<515c64960909162234j3213b698q5857246d0ab15b5f%mail.gmail.com@localhost>,
Channa  <channa.kad%gmail.com@localhost> wrote:
>Hi,
>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)
>#endif
>
>#ifndef INF
>#define INF (1.0f/0.0f)
>#endif
>
>
>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.

christos



Home | Main Index | Thread Index | Old Index