On Wednesday 21 February 2007 13:26, [EMAIL PROTECTED] wrote:
[...]
> What is definition of behavior if some wants to  add sub mul div
> +Inf ( 0x7f8000000) -Inf (0xff800000) NaN (0x7fc00000)
>
> Can we forget to handle -NaN ( 0xffc00000) if none of our programs never
> creates such floats
>
> What should happen with -0 (x80000000)
>
> Do we need to handle denormized values as 0x03445566 or 0x00000001 ? How ?
> Do we need to handle other forms of NaN as 0x7f800200 or 0x7f800002 ?
[...]

Today, the CVS avr-libc float arithmetic and math library are very
close to i386 gcc/glibc ones.  It operates subnormals, -0.0, +Inf
and -Inf. All other numbers (0x7f800001-0x7fffffff and 0xff800001-
0xffffffff) are treated as NaNs.
For example:
        Inf + Inf --> Inf
        Inf - Inf --> NaN
        NaN == NaN --> false
        0.0 == -0.0 --> true
        1/-0.0 --> -Inf
        sqrt(-0.0) --> -0.0     (Yes!)
        ...

A good info about all unnormal cases is in files from
tests/simulate/fplib and math directories. All lines
(except a very small number of cases in fuctions) are
true with i386 gcc/glibc.

Dmitry.



_______________________________________________
AVR-libc-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-libc-dev

Reply via email to