Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the approximate resolution of a single precision floating point number when its around zero

I am storing many longitudes and latitudes as doubles, I am wondering if I can get away with storing them as floats.

To answer this question, I need to know the approximate resolution of a single precision floating point number when the stored values are longitudes / latitudes (-180 to +180).

like image 712
Robert Avatar asked Oct 28 '11 20:10

Robert


People also ask

What is the resolution of a 32 bit floating point number?

They both use 32 bit IEEE-754 floating point numbers (single precision). This format has a 24 bit mantissa (if you count the hidden bit), so the effective resolution is between one part in 2 23 (eight million) and one part in 2 24 (16 million). This supports six or seven decimal digits of resolution.

What is single precision floating-point format?

Single-precision floating-point format is a computer number format, usually occupying 32 bits in computer memory; it represents a wide dynamic range of numeric values by using a floating radix point . A floating-point variable can represent a wider range of numbers than a fixed-point variable...

What is the resolution of IEEE floating point?

Floating Point Resolution. They both use 32 bit IEEE-754 floating point numbers (single precision). This format has a 24 bit mantissa (if you count the hidden bit), so the effective resolution is between one part in 2 23 (eight million) and one part in 2 24 (16 million). This supports six or seven decimal digits of resolution.

How are floating-point numbers represented?

According to IEEE standard, floating-point number is represented in two ways: 1. Single Precision: Single Precision is a format proposed by IEEE for the representation of floating-point numbers. It occupies 32 bits in computer memory. 2.


1 Answers

The resolution you can count on with single-precision floats is about 360 / (2 ^ 23) or 4 * 10 ^ -5.

More precisely, the largest single-precision float strictly inferior to 360. (which is representable exactly) is about 359.999969. For the whole range -360. .. 360, you will be able to represent differences at least as small as the difference between these two numbers.

like image 172
Pascal Cuoq Avatar answered Oct 13 '22 00:10

Pascal Cuoq