Native support for unbound numeric computations / BigInt / AIR model / Arbitrary wide integers #892
DmT021
started this conversation in
Language design
Replies: 1 comment
-
I'm planning on adding
Ditto for I think |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The only case where I still use python instead of Swift scripting is when I need to compute some math involving arbitrary large numbers.
Fixed width integer operations combines badly with natural math. I.e. the result of multiplication of two 32 bit integers will be 64 bit integer. If we try to model math operations the way they produce fixed width integers with width enough to guarantee safety, we will run out of space immediately.
There are several approaches to this:
Array
).WideInt<512>
- means integer of size 512 bits, likeBuffer
)An interesting aspect of having such types as natives is the ability to provide transparent vectorization for them.
Beta Was this translation helpful? Give feedback.
All reactions