Closed dchenbecker closed 6 months ago
The digits() function doesn't always return correct results for negative numbers:
digits()
| input | digits | expected | |-------+--------+----------| | -1 | 0 | 1 | | -2 | 0 | 1 | | -3 | 0 | 1 | | -4 | 0 | 1 | | -5 | 0 | 1 | | -6 | 0 | 1 | | -7 | 0 | 1 | | -10 | 1 | 2 | | -11 | 1 | 2 | | -12 | 1 | 2 |
And so on. It does appear to work correctly for positive numbers, so a simple workaround is to call neg() to change the sign before calling digits(), but I'll see if I can figure out a proper fix.
neg()
I guess this partly explains #75.
As of version 0.4.1, this is fixed.
Good. Closing.
The
digits()
function doesn't always return correct results for negative numbers:And so on. It does appear to work correctly for positive numbers, so a simple workaround is to call
neg()
to change the sign before callingdigits()
, but I'll see if I can figure out a proper fix.