Re:Show HN: Shellmath: Floating-point arithmetic directly in...
by clarity20 on Thursday February 25, 2021 @09:13AM
(#26262894)
Thank you, I tried to make the code as readable as I could. And yes, since the *nix model for (sub)processes is cleaner than Cygwin-on-Windows it's kind of surprising that that gap is what it is.
Thumbing through the code made me wonder what the zsh(my normal shell) implementation feels like, and I think it is fair to say your code is easier to wrap your head around than the documentation for floats in zsh.
FWIW - and given that you've only shown Windows timings - on my Linux box hyperfine shows:
I expected the speeds to be closer because of the differences with subshells on Windows and Linux, but the distance still surprised me.¹ https://en.m.wiktionary.org/wiki/contranym - choose one