[OpenSmalltalk/opensmalltalk-vm] Bug in primitive 551 (SmallFloat64>> truncated) (#376)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[OpenSmalltalk/opensmalltalk-vm] Bug in primitive 551 (SmallFloat64>> truncated) (#376)

David T Lewis
 

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.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/OpenSmalltalk/opensmalltalk-vm","title":"OpenSmalltalk/opensmalltalk-vm","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Bug in primitive 551 (SmallFloat64\u003e\u003e truncated) (#376)"}],"action":{"name":"View Issue","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/376"}}}</script> <script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/376", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/376", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Bug in primitive 551 (SmallFloat64>> truncated) (#376)

David T Lewis
 

Closed #376 via 484d768.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/OpenSmalltalk/opensmalltalk-vm","title":"OpenSmalltalk/opensmalltalk-vm","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Closed #376 via 484d7684e6ab79d3a0273751653d08c5cc5b0605."}],"action":{"name":"View Issue","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/376#event-2198681972"}}}</script> <script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/376#event-2198681972", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/376#event-2198681972", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Bug in primitive 551 (SmallFloat64>> truncated) (#376)

David T Lewis
In reply to this post by David T Lewis
 

Should be fixed by commit 484d768


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/OpenSmalltalk/opensmalltalk-vm","title":"OpenSmalltalk/opensmalltalk-vm","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm"}},"updates":{"snippets":[{"icon":"PERSON","message":"@eliotmiranda in #376: Should be fixed by commit 484d7684e6ab79d3a0273751653d08c5cc5b0605"}],"action":{"name":"View Issue","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/376#issuecomment-472208896"}}}</script> <script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/376#issuecomment-472208896", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/376#issuecomment-472208896", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Bug in primitive 551 (SmallFloat64>> truncated) (#376)

David T Lewis
In reply to this post by David T Lewis
 

Thanks! I've added a test as well.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/OpenSmalltalk/opensmalltalk-vm","title":"OpenSmalltalk/opensmalltalk-vm","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm"}},"updates":{"snippets":[{"icon":"PERSON","message":"@fniephaus in #376: Thanks! I've added [a test](http://forum.world.st/The-Trunk-KernelTests-fn-356-mcz-td5096677.html) as well."}],"action":{"name":"View Issue","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/376#issuecomment-472250269"}}}</script> <script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/376#issuecomment-472250269", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/376#issuecomment-472250269", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>