Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify definition of NaN #704

Closed
wants to merge 1 commit into from

Conversation

bnoordhuis
Copy link
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
Contributor

saghul commented Nov 18, 2024

ha, it does work!

@saghul
Copy link
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
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