• Explorer09's avatar
    Change variable 'dot' to avoid division by reciprocal. · d56bcd8e
    Explorer09 authored
    The variable 'dot' in GraphMeterMode_draw now means "maximum number of
    dots per value (column) in graph". The old meaning was "amount of value
    that is to be represented by a dot" and was always a fraction. Due to
    a limitation in floating point computing, if GRAPH_HEIGHT were not a
    power of 2, then rounding errors will occur on numbers like (1.0/3).
    (Currently GRAPH_HEIGHT is 4 and so no precision loss.) 'dot' was used
    as a divisor, and it's "division by a reciprocal". We change that to
    simple multiplication.
    d56bcd8e
Meter.c 16.1 KB