3 ms·
This looks good, but, I noticed: > Supported Functions (v1) > SUM, AVERAGE, COUNT, MIN, MAX, IF I would recommend switching to numerically stable algorithms f
by nanis 5mo ago
This looks good, but, I noticed:
> Supported Functions (v1)
> SUM, AVERAGE, COUNT, MIN, MAX, IF
I would recommend switching to numerically stable algorithms for adding numbers and taking their averages sooner rather than later.
Looking at the code[1], it looks like you are simply summing the numbers and dividing by count. If that is indeed the case, please switch to a stable average[2]. See also [3].
Additionally, I tried to test the executable[4] on Windows, but there is something wrong with input. Using Windows Terminal Version: 1.24.10921.0, characters are doubled on input. Regular Vim compiled using Visual C++ does not have this issue.
When I press `:`, I get `::` in the COMMAND line. Then, every key I press gets doubled. This means I cannot `:q!`. :-)
[1]: https://github.com/garritfra/cell/blob/99b0afc7a60a871b274527a1b154e0d713ab8cf5/crates/cell-sheet-core/src/formula/functions.rs#L24 https://github.com/garritfra/cell/blob/99b0afc7a60a871b27452...
[2]: https://www.nu42.com/2015/03/how-you-average-numbers.html https://www.nu42.com/2015/03/how-you-average-numbers.html
[3]: https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Online_algorithm https://en.wikipedia.org/wiki/Algorithms_for_calculating_var...
[4]: https://github.com/garritfra/cell/releases/tag/v0.2.0 https://github.com/garritfra/cell/releases/tag/v0.2.0
- garritfra 5mo agoThis is valuable feedback. I opened two issues to track this: Use numerically stable algorithms for SUM and AVERAGE: https://github.com/garritfra/cell/issues/43 https://github.com/garritfra/cell/issues/43 Keystrokes doubled in Windows Terminal: https://github.com/garritfra/cell/issues/44 https://github.com/garritfra/cell/issues/44 Thanks!
- nanis 5mo agoI was able to test the keystroke-doubling and that works well in Windows Terminal now. I am going to try out the formulas later.
- sev_verso 5mo agoInteresting. Last time I dealt with currency in SQL (which was well over a decade ago admittedly), we used a fixed point format for those fields. What do you recon Excel does, floating point math for regular entries and lossless point math for currency? Or just does not rely on floats at all?