Title: NaN vs -NaN (negative NaN) on macOS/arm64 · Issue #2909 · AssemblyScript/assemblyscript · GitHub
Open Graph Title: NaN vs -NaN (negative NaN) on macOS/arm64 · Issue #2909 · AssemblyScript/assemblyscript
X Title: NaN vs -NaN (negative NaN) on macOS/arm64 · Issue #2909 · AssemblyScript/assemblyscript
Description: Bug description Strange issue found while working on something unrelated. It seems that in certain cases, the compiler creates NaN on some platforms, and -NaN on others. This can lead to test failures. I encountered it first here: #2908 ...
Open Graph Description: Bug description Strange issue found while working on something unrelated. It seems that in certain cases, the compiler creates NaN on some platforms, and -NaN on others. This can lead to test failu...
X Description: Bug description Strange issue found while working on something unrelated. It seems that in certain cases, the compiler creates NaN on some platforms, and -NaN on others. This can lead to test failu...
Opengraph URL: https://github.com/AssemblyScript/assemblyscript/issues/2909
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"NaN vs -NaN (negative NaN) on macOS/arm64","articleBody":"### Bug description\n\nStrange issue found while working on something unrelated. It seems that in certain cases, the compiler creates `NaN` on some platforms, and `-NaN` on others. This can lead to test failures.\n\nI encountered it first here:\nhttps://github.com/AssemblyScript/assemblyscript/pull/2908#issuecomment-2640748643\n\nBut a search found that we've seen it before.\nhttps://github.com/AssemblyScript/assemblyscript/pull/2352/files/403cae846a804c829b70bd2de388c3286cfdb899?diff=unified\u0026w=0#r931976127\n\n(wait about 5-10 seconds for GitHub to jump to the comment thread on that last link)\n\nI'm not sure if this an macOS issue or an arm64 issue, but in both cases that was the platform. It does not occur on Linux or Windows x64.\n\nWriting this up mostly so it doesn't get lost. I haven't found any practical implications yet. Some opinions about `NaN` vs `-NaN` seems to think it's not very important: https://stackoverflow.com/questions/21349847/positive-vs-negative-nans\n\nPerhaps already fixed by a newer Binaryen implementation? 🤷 \n\n### Steps to reproduce\n\nOn a macOS/arm64 machine:\n\n```\nnpm run test:compiler -- std/math --create\ngit diff\n```\n\nObserve a bunch of changes like this:\n\n```diff\n- f64.const -nan:0x8000000000000\n+ f64.const nan:0x8000000000000\n```\n\n### AssemblyScript version\n\nv0.27.32","author":{"url":"https://github.com/mattjohnsonpint","@type":"Person","name":"mattjohnsonpint"},"datePublished":"2025-02-06T20:18:18.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/2909/assemblyscript/issues/2909"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c7fa418f-0b64-0f90-dbee-b6b7232aabec |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EB88:BE940:4FC87E6:6B5DF2A:696E0882 |
| html-safe-nonce | b17828d6a6c35455e4bacc1152ffa741a04ea42d6c33b6588105f2f3a49228f3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjg4OkJFOTQwOjRGQzg3RTY6NkI1REYyQTo2OTZFMDg4MiIsInZpc2l0b3JfaWQiOiI3OTM0NjAzNzMyMjUwODA5NjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 98c12eafd89e3b5f51f17aa8390a704688d84abbdebee20f0329f9ae8c18a453 |
| hovercard-subject-tag | issue:2836498541 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/AssemblyScript/assemblyscript/2909/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e420c97a63a979cdfd74ddce31e3d2fa3e3926d4d6054f2085e5f811b70e5808/AssemblyScript/assemblyscript/issues/2909 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e420c97a63a979cdfd74ddce31e3d2fa3e3926d4d6054f2085e5f811b70e5808/AssemblyScript/assemblyscript/issues/2909 |
| og:image:alt | Bug description Strange issue found while working on something unrelated. It seems that in certain cases, the compiler creates NaN on some platforms, and -NaN on others. This can lead to test failu... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mattjohnsonpint |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9b5131b207ddd175abf059a848d5f4302ec0606b02211b989013be49cf08593e |
| turbo-cache-control | no-preview |
| go-import | github.com/AssemblyScript/assemblyscript git https://github.com/AssemblyScript/assemblyscript.git |
| octolytics-dimension-user_id | 28916798 |
| octolytics-dimension-user_login | AssemblyScript |
| octolytics-dimension-repository_id | 105138356 |
| octolytics-dimension-repository_nwo | AssemblyScript/assemblyscript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 105138356 |
| octolytics-dimension-repository_network_root_nwo | AssemblyScript/assemblyscript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f8590a63bfc8093b241930ca57d536c9a50f9680 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width