Adaptive number of significant digits
Adaptively increase the number of significant digits if the user input seems to require it:
> 3e6 + 0.1
3000000
Also, the different handling of integers and floating point numbers seems strange right now:
> 3e7 + 1
30000001
> 3e7 + 1.1
30000000
Also, 0.1428571*7=1 Doesn't seem like a high precision calculator
And also having the possibility to change the number of significant digits during a session could be a very useful feature (it is for me...)!
@sharkdp Stupid question: Why shouldn't Insect output all digits. Then the user can decide how many digits he wants to use ^^
Also: I guess many people would like to use insect as a replacement for calc, so maybe insect should output similar solutions. E.g. calc easily handles things like calc '3e1000 + 0.1'
I agree the current behaviour is very confusing. There's even a difference between big and small integers:
> 111111111111111111
111111111111111111
= 111111111111111111
> 1111111111111111111
1111111111111111111
= 1111110000000000000
I think a more usable default would be to display six (or even eight) digits after the dot. It can be still made configurable later on.
Otherwise at least use scientific notation when showing numbers bigger than 1e6 (now it does from 1e20 on, which seems a reasonable default).
@ad-si note that calc is an arbitrary precision calculator, while insect is just high precision.
I agree the current behaviour is very confusing
Yes. This ticket describes my personal top-prio issue with Insect.
I think a more usable default would be to display six (or even eight) digits after the dot. It can be still made configurable later on.
We could try this. I don't really like the fact that we would display far too many digits for most computations though.
I just want to confirm how important it is for some application to display >6 digits. Is there a way around it for now? I want to do 123456789/33 but need at least 15 significant digits.
@sharkdp I think this could be nice to implement in v5.9.0, but the major initial hurdle would be how to add it cleanly to purescript-decimals's API. Do you have any ideas how we could do that?
Do you have any ideas how we could do that?
I have not thought about it in detail, but I'm quite sure it's a highly nontrivial thing to do.
@sharkdp alright then, let's leave it for later (or never?) then.
Follow-up ticket for Numbat: https://github.com/sharkdp/numbat/issues/179