• jjjalljs@ttrpg.network
    link
    fedilink
    arrow-up
    9
    ·
    18 hours ago

    Use a dedicated data type or library. Some languages also have something like python’s Decimal type

    >>> .1 + .2
    0.30000000000000004
    >>> Decimal(".1") + Decimal(".2")
    Decimal('0.3')