diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-09 10:23:15 +1100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-02-08 18:15:51 -0800 |
commit | b286ea638c8ce468cf9c1a1b5037867acb5d6fe4 (patch) | |
tree | e6d593baf90d399b0532e0b6033905f219692483 /subsurface-icon.svg | |
parent | ff969cd5c84824170b382901b49a97564bf72bfa (diff) | |
download | subsurface-b286ea638c8ce468cf9c1a1b5037867acb5d6fe4.tar.gz |
Simplify/clarify the get_surface_pressure_in_mbar() function
Instead of maintaining a rolling average and re-calculating it at each
stage, just calculate the surface_pressure average the natural way: as
the sum divided by the number of entries.
This results in a single rounding, rather than doing rounding multiple
times and possibly rounding wrong as a result.
Not that we care all that deeply about the LSB of the mbar value, but
the code is simpler and more obvious this way too.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-icon.svg')
0 files changed, 0 insertions, 0 deletions