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.

Advertisement

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

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

Follow

Get every new post delivered to your Inbox.