PaddiM8 / kalker

Scientific calculator with math syntax that supports user-defined variables and functions, complex numbers, and estimation of derivatives and integrals
https://kalker.xyz
MIT License
1.64k stars 74 forks source link

Big Integers are incorrect resulting in errors doing modular arithmetic #130

Open pfzetto opened 8 months ago

pfzetto commented 8 months ago

Hello, thanks for this nice calculator. I've noticed that big values are used incorrectly (without a warning), causing severe errors when doing modular arithmetic. Example:

>> 102917891787974167652675165103770584593272553218
102 917 891 787 974 168 813 411 935 694 013 722 883 721 789 440

Also values over 1 000 000 cannot be displayed using the base x option.

Is this a known limitation? I think an operation like 0x1206ff74fcfe76f159750c0e1ccc34a5d0c23f02 mod 0xb0b should not return a result when it's wrong.

Reagards, Paul

PaddiM8 commented 6 months ago

Hmm yeah it is not as accurate when parsing big numbers. When you do eg. 10^100 you will get the exact value, but not if when you do 100000000000000000. This needs to be fixed indeed.

PaddiM8 commented 6 months ago

This is mostly fixed now, but still a bit limited with different bases. 0x1206ff74fcfe76f159750c0e1ccc34a5d0c23f02 mod 0xb0b gives me 475 now.