[Top][All Lists]

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

AW: [avr-gcc-list] isnan() and isinf()

From: Stumpf Michael
Subject: AW: [avr-gcc-list] isnan() and isinf()
Date: Tue, 26 Feb 2002 07:45:12 +0100


Are you using the libm fp library?
The doc says that only one type of NaN / INF is supported and that is the value FFC0XXXX.
(the upper 10 bits set).

So you can easily define a macro

#define isnan(f) ((((uint_32)(f))&0xFFC00000) == 0xFFC00000)

same for isinf

BTW: since there are no subnormals supported the macro for isnormal would be

#define isnormal(f) ((((uint_32)(f))!=0) && !isnan(f) )

hope this helps, regards

Michael Stumpf

> -----Urspr√ľngliche Nachricht-----
> Von: Geoffrey Wossum [mailto:address@hidden]
> Gesendet: Montag, 25. Februar 2002 17:53
> An: address@hidden
> Betreff: [avr-gcc-list] isnan() and isinf()
> Hi,
> isnan() and isinf() seem to be missing from the floating
> point support in
> the avr-libc.  Are there really there and I'm just not seeing
> them.  If
> they're not there, how can I tell if my arithmetic overflows
> or gets an
> error?
> TIA,
> ---
> Geoffrey Wossum
> Project AKO - http://ako.sf.net
> avr-gcc-list at http://avr1.org

reply via email to

[Prev in Thread] Current Thread [Next in Thread]