-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement all LargeInteger Primitives (20-39) #37
Comments
I needed integers a little bigger than default (in a 32 bit image). Therefore added a number of the LargeInteger primitives using the technique mentioned with 53-bit JS logic/support. If interested, you can find it here: ErikOnBike@8df8f91 |
This breaks
This is performing Instead of The other operations do not look quite correct either. E.g. division needs to fail if the result is not an integer, so that the image fallback code can construct a So while this may work for your specific purposes, my goal for SqueakJS is to provide a VM with perfectly accurate semantics, even if it comes with speed penalties. |
... that being said, implementing these primitives is still a Good Idea. For best speed I would even try to use JS The reason I haven't done that yet is because the 53 bit stuff is only used for clock operations so far which are all positive. The most used LargeIntegers besides for clock purposes is full 32 bit operations, which is implemented by the various "pos32Bit" functions. All other LargeInts are handled by the image fallback code which uses the LargeInteger plugin transpiled from Slang. |
Hmmm. Hadn't tried it on regular images. I'm using it with my tiny 32-bit image. The 53-bit support is already very welcome for things like a clock or some browser identifiers. I use a custom makeStObject so I might have different results. Your findings makes me think I should perform some additional tests though ;-). Thx |
I don't have Fractions in my image, so Float works for me. But I understand and agree SqueakJS in general should be fully compatible. Small thing: I think the optimised "obj == (obj|0)" in makeStObject does not (or did not seem to) work in all cases. I replaced it with "Number.isInteger(obj)" which works for me. YMMV |
The line in
Since my If you were to use In practice, I've never observed We could also make |
... using 53 bit logic, as in e3627a0?
... and ideally, using JS
BigInt
numbers if we get outside the 53 bit range, instead of failing the prims.The text was updated successfully, but these errors were encountered: