Float Point representaion Flashcards
(5 cards)
Rule1
The order of evaluation can affect the accuracy of the result.
Rule2
Whenever subtracting two numbers with the same signs or adding two numbers
with different signs, the accuracy of the result may be less than the precision avail-
able in the floating-point format:
Rule3
When performing a chain of calculations involving addition, subtraction,
multiplication, and division, try to perform the multiplication and division
operations first:
x × (y + z) === x × y + x × z
Rule4
When multiplying and dividing sets of numbers, try to multiply and divide numbers that have the same relative magnitudes.
Rule5
When comparing two floating-point numbers for equality, always compare the values to see if the difference between two values is less than some small error value.