manpagez: man pages & more
info gawk
Home | html | info | man

File: gawk.info,  Node: Inexactness of computations,  Next: Getting Accuracy,  Up: FP Math Caution

16.4.1 Floating-Point Arithmetic Is Not Exact
---------------------------------------------

Binary floating-point representations and arithmetic are inexact.
Simple values like 0.1 cannot be precisely represented using binary
floating-point numbers, and the limited precision of floating-point
numbers means that slight changes in the order of operations or the
precision of intermediate storage can change the result.  To make
matters worse, with arbitrary-precision floating-point arithmetic, you
can set the precision before starting a computation, but then you cannot
be sure of the number of significant decimal places in the final result.

* Menu:

* Inexact representation::      Numbers are not exactly represented.
* Comparing FP Values::         How to compare floating point values.
* Errors accumulate::           Errors get bigger as they go.
* Strange values::              A few words about infinities and NaNs.

© manpagez.com 2000-2025
Individual documents may contain additional copyright information.