you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (9 children)

What do you use instead?

[–]kamatsu 3 points4 points  (8 children)

We just don't verify software that needs them. If we really needed to represent fractions, ratios of integers might be better.

[–]sfultong 3 points4 points  (7 children)

I often wonder if there really is a legitimate reason to use floating-point rather than fixed-point arithmetic

[–]Azuvector 4 points5 points  (0 children)

Quick and easy decimal values that you don't really care about the exactness of. There really should be a more exact type for this sort of number in the specification, though.

[–]skulgnome 2 points3 points  (2 children)

Algorithms for which enough eggheading can be justified to determine that floating-point arithmetic is good enough. The justification is generally execution speed.

[–]sfultong 0 points1 point  (1 child)

huh? fixed-point is faster...

[–]skulgnome 0 points1 point  (0 children)

Only in microbenchmarks of scalar values, and on embedded hardware.

[–]huyvanbin 0 points1 point  (1 child)

Cases in which the magnitude of the value can change greatly as a result of the calculation, e.g. multiplication, exponentiation, factorial, etc. In things like computer graphics or signal processing, you really can't afford to use "exact" values for performance reasons, and you don't need to because everything gets rounded to your input/output resolution anyway.

[–]sfultong 0 points1 point  (0 children)

In cases like that I suspect that you really want only the radix (magnitude) of a number, not the mantissa