Zhou on WordPress

December 4, 2011

floating point number

Filed under: Uncategorized — zhouji @ 11:31 am

I am imaging the gap between the floating point numbers represented in computer. Let’s compare an int and a float in 32 bits. The largest positive int is 2^16-1, and it is quite obvious that we cannot have that number, say, x and x-1 both represented in float. Furthermore, considering all the fractions we want to represent in the same 32 bits, the gap between two consecutive floating point numbers must be really large around x. It should be even bigger for larger numbers.

Theme: Shocking Blue Green. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.