Skip to content

Simplify definition of NaN#704

Closed
bnoordhuis wants to merge 1 commit intoquickjs-ng:masterfrom
bnoordhuis:simpler-nan
Closed

Simplify definition of NaN#704
bnoordhuis wants to merge 1 commit intoquickjs-ng:masterfrom
bnoordhuis:simpler-nan

Conversation

@bnoordhuis
Copy link
Copy Markdown
Contributor

@bnoordhuis bnoordhuis commented Nov 18, 2024

Replace u64->double bitcast with 0.0/0.0


Because I'm curious if it really works everywhere (it should)

@saghul
Copy link
Copy Markdown
Contributor

saghul commented Nov 18, 2024

ha, it does work!

@saghul
Copy link
Copy Markdown
Contributor

saghul commented Nov 18, 2024

I don't have a strong opinion whether we should have this or the current one in master.

Replace u64->double bitcast with 0.0/0.0.

Change definition of JS_FLOAT64_NAN in the same way because that lets us
drop <math.h> from quickjs.h.

Replace INFINITY and -INFINITY with 1.0/0.0 and -1.0/0.0 respectively
because we already defined globalThis.INFINITY that way and so we might
as well go all the way.
@bnoordhuis
Copy link
Copy Markdown
Contributor Author

Ha, you were right w.r.t 0.0/0.0 - VS 2019 rejects it. Definitely a compiler bug but okay, that settles that, closing.

D:\a\quickjs\quickjs\cutils.h(365,1): error C2124: divide or mod by zero [D:\a\quickjs\quickjs\build\qjs.vcxproj]

@bnoordhuis bnoordhuis closed this Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants