4 ms·
Really? I haven't heard of any bugs in the command line calculators. Do you know what kinds of bugs they were talking about? One thing to note is that they use
by lambda 11y ago
Really? I haven't heard of any bugs in the command line calculators. Do you know what kinds of bugs they were talking about? One thing to note is that they use arbitrary-precision decimal arithmetic (well, base-100 arithmetic internally, but that's equivalent), rather than fixed precision binary floating point arithmetic, so that may surprise some people (though it also reduces surprise for those who expect decimal arithmetic).
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#History https://en.wikipedia.org/wiki/Dc_%28computer_program%29#Hist...)
- acomjean 11y agoI 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 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. "
- lambda 11y agoAh, 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.