Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When to use Fixed Point these days

Tags:

For intense number-crunching i'm considering using fixed point instead of floating point. Of course it'll matter how many bytes the fixed point type is in size, on what CPU it'll be running on, if i can use (for Intel) the MMX or SSE or whatever new things come up...

I'm wondering if these days when floating point runs faster than ever, is it ever worth considering fixed point? Are there general rules of thumb where we can say it'll matter by more than a few percent? What is the overview from 35,000 feet of numerical performance? (BTW, i'm assuming a general CPU as found in most computers, not DSP or specialized embedded systems.)

like image 270
DarenW Avatar asked Oct 05 '08 02:10

DarenW


People also ask

When should you use fixed point over floating-point?

A fixed point number just means that there are a fixed number of digits after the decimal point. A floating point number allows for a varying number of digits after the decimal point. For example, if you have a way of storing numbers that requires exactly four digits after the decimal point, then it is fixed point.

Why do we use fixed point?

The use of fixed point data type is used widely in digital signal processing (DSP) and game applications, where performance is sometimes more important than precision. As we will see later, fixed point arithmetic is much faster than floating point arithmetic.

Is fixed point more accurate?

Therefore, using the same number of bits, fixed-point has more resolution than floating-point. Even with other choices of how many bits to use for which parts, floating-point needs to use some bits for the exponent, and fixed-point uses zero, so fixed-point always has finer resolution than floating-point.

What is fixed point example?

Fixed point of a function Not all functions have fixed points: for example, f(x) = x + 1, has no fixed points, since x is never equal to x + 1 for any real number. In graphical terms, a fixed point x means the point (x, f(x)) is on the line y = x, or in other words the graph of f has a point in common with that line.


1 Answers

It's still worth it. Floating point is faster than in the past, but fixed-point is also. And fixed is still the only way to go if you care about precision beyond that guaranteed by IEEE 754.

like image 69
John Millikin Avatar answered Dec 28 '22 22:12

John Millikin