[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua_number2int
- From: roberto@... (Roberto Ierusalimschy)
- Date: Tue, 14 Nov 2006 21:32:57 -0200
> ¶1 When a finite value of real floating type is converted to an integer type
> other than _Bool, the fractional part is discarded (i.e., the value is
> truncated toward zero). If the value of the integral part cannot be
> represented by the integer type, the behavior is undefined.)
> [...]
> Therefore, casting (double)0xFFFFFFFF to an unsigned int is valid, [...]
But it seems that casting (double)-1 to an unsigned int will result in
daemons flying out of our noses.
-- Roberto