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

Double floats need to be cocerced into single floats #404

Open
Partmedia opened this issue Dec 30, 2024 · 0 comments
Open

Double floats need to be cocerced into single floats #404

Partmedia opened this issue Dec 30, 2024 · 0 comments

Comments

@Partmedia
Copy link

I'm using clog from the 2024-10-12 quicklisp distribution.

When I pass a double float (e.g. 0.52d0) into ROTATE in CLOG-Canvas, my canvas transform does not rotate. However, it does when passing a single-float or other literal (e.g. -1).

I believe that the double floating literal printing format used by Common Lisp is confusing JavaScript. The two successful workarounds I found were to:

  • Format a double float as a string, e.g. (format-string nil "~f" 0.52d0)
  • Coerce to single string, e.g. (coerce 0.52d0 'single-float)

I suspect that this bug exists in other functions as well, but I didn't test any others.

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

No branches or pull requests

1 participant