Skip to content

Fix inaccuracy about NaN sign bit - #44707

Merged
Josh-Cena merged 3 commits into
mdn:mainfrom
zacklukem:patch-1
Jul 20, 2026
Merged

Fix inaccuracy about NaN sign bit#44707
Josh-Cena merged 3 commits into
mdn:mainfrom
zacklukem:patch-1

Conversation

@zacklukem

Copy link
Copy Markdown
Contributor

Description

  • Fix inaccuracy about changing NaN sign bit
  • Add note about platform dependance in the example

Motivation

Previously this example claimed that the example code was changing the sign bit of the float, which doesn't effect NaN values. However, the example was actually modifying the fraction component (which also doesn't affect NaN values).

These changes correct that inaccuracy by being less specific about why the bit change still results in a NaN value.

Additional details

https://en.wikipedia.org/wiki/NaN#Encoding

Related issues and pull requests

@zacklukem
zacklukem requested a review from a team as a code owner July 13, 2026 21:58
@zacklukem
zacklukem requested review from sideshowbarker and removed request for a team July 13, 2026 21:58
@github-actions github-actions Bot added Content:JS JavaScript docs size/s [PR only] 6-50 LoC changed labels Jul 13, 2026
Comment thread files/en-us/web/javascript/guide/equality_comparisons_and_sameness/index.md Outdated
Comment thread files/en-us/web/javascript/guide/equality_comparisons_and_sameness/index.md Outdated
@zacklukem
zacklukem requested a review from Josh-Cena July 16, 2026 00:23
Comment thread files/en-us/web/javascript/guide/equality_comparisons_and_sameness/index.md Outdated

@Josh-Cena Josh-Cena left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you!

@github-actions

Copy link
Copy Markdown
Contributor

@Josh-Cena
Josh-Cena merged commit 188029a into mdn:main Jul 20, 2026
9 checks passed
estelle pushed a commit to estelle/content that referenced this pull request Jul 28, 2026
* Fix inaccuracy with NaN sign bit

* Update sign bit

* Apply suggestion from @Josh-Cena

---------

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:JS JavaScript docs size/s [PR only] 6-50 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants