[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: math.tofloat (or how to check if number has float representation)
- From: "Soni L." <fakedme@...>
- Date: Sat, 17 Jan 2015 16:36:32 -0200
On 17/01/15 04:29 PM, Luiz Henrique de Figueiredo wrote:
How do I check if x can be represented as a float? For example, for
64-bit integers and 64-bit floats, (1<<62)+5 cannot be represented
as a float, but 1<<62 can.
print(x == math.tointeger(x+0.0))
What if x is a float?
Disclaimer: these emails are public and can be accessed from <TODO: get a non-DHCP IP and put it here>. If you do not agree with this, DO NOT REPLY.