Have you performed simple arithmetic operations like 0.1 + 0.2? You might have gotten something strange: 0.1 + 0.2 = 0.30000000000000004.

  • ericjmorey@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    3 months ago

    Perhaps the following rewording of your last sentence would be easier for readers to follow along:

    With a lack of precision, 1/3 might become 0.33333333. When evaluating the expression 1/3 + 1/3 + 1/3, using 0.33333333 as an approximate representation of 1/3 will return a result of 0.99999999, instead of the correct answer of 1.