Re:How does the calculator percent key work? (2008)
by acomjean on Wednesday April 29, 2015 @11:17PM
(#9463153)
I did some digging. it was in this thread in a comment about bc and exponents (although I can't use a non rpn calculator on computers I just tend to type the formulas in):
https://news.ycombinator.com/item?id=5054618
a couple of replies to my comment there about exponents. specifically.
"bc is a pretty misleading calculator, without specifying rounding it thinks 2^(40/1.5) is 67108864.
It's not even close.
If you trust your finances to that, you could get in trouble. "
Re:How does the calculator percent key work? (2008)
by lambda on Thursday April 30, 2015 @10:03AM
(#9465093)
Ah, thanks for digging that up. I was not aware that they didn't support fractions in exponents; I don't think I had ever tried them for that. Luckily they do give warnings, though only if you have already set the precision (via "bc -l" or something like "10 k" in dc).
Sadly, since dc doesn't have a math library, it looks like you can't use the "e" function workaround unless you implement it yourself.
Interesting tidbit, it seems that dc is the oldest language on Unix; it was ported before even an assembler was. (https://en.wikipedia.org/wiki/Dc_%28computer_program%29#Hist...)