There is a bug in an edge case in #truncated primitive in 64 bits Cog Spur (tested on Linux, both in Cuis and Squeak). It is when #truncated a Float that is slightly larger than SmallInteger maxVal. SmallInteger maxVal --> 1152921504606846975
If we take (1152921504606846975.0 predecessor), to ensure a Float that still fits in a SmallInteger, everything works fine: 1152921504606846975.0 predecessor asTrueFraction --> 1152921504606846848 1152921504606846975.0 predecessor asTrueFraction --> class SmallInteger 1152921504606846975.0 predecessor truncated --> 1152921504606846848
But taking 1152921504606846976.0: 1152921504606846976.0 asTrueFraction --> 1152921504606846976 (correct result) 1152921504606846976.0 asTrueFraction class --> LargePositiveInteger (ok. Doesn't fit in SmallInteger) 1152921504606846976.0 truncated --> -1152921504606846976 The primitive is answering SmallInteger minVal, (a negative number!) but it should fail, as the correct result doesn't fit in a SmallInteger.
Closed #376 via 484d7684e6ab79d3a0273751653d08c5cc5b0605.
Should be fixed by commit 484d7684e6ab79d3a0273751653d08c5cc5b0605
Thanks! I've added [a test](http://forum.world.st/The-Trunk-KernelTests-fn-356-mcz-td5096677.html) as well.
vm-dev@lists.squeakfoundation.org