11 ms·
> Bash doesn't even support floating point! But bc (and dc) does, and shell authors deemed this was good enough. And that's part of the problem with the "Unix
by nextaccountic 3y ago
> Bash doesn't even support floating point!
But bc (and dc) does, and shell authors deemed this was good enough.
And that's part of the problem with the "Unix philosophy"
- softwaredoug 3y agoYeah every invocation of bc is a call to a command. So if you do it in a loop, its going to be very slow. I had to do this once. It was so slow, I decided to use integers in kind of fixed-point math where I just multiply all the floats by 100 and work with ints. zsh supports float though
- worksonmine 3y agoDid you consider preparing the arguments in the loop then run them all at once?