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

bug when stringifying exponent markers #45

Closed
jsulmont opened this issue May 7, 2023 · 5 comments
Closed

bug when stringifying exponent markers #45

jsulmont opened this issue May 7, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@jsulmont
Copy link

jsulmont commented May 7, 2023

Hi
Firstly thank you for this library!
There is probably a bug when stringifying floats with (any) exponent markers:

(jzon:stringify 1.0d0)                ;; =>  "�^@.0"
(jzon:stringify 12.0d0))            ;; =>   "�^@1.0"
(jzon:stringify 123456.0s0)     ;; =>   "^@12345.0"

;; 

I'll try to come up with a PR; but in the meantime, would appreciate if anyone has an idea.
Thank you!!

@Zulu-Inuoe
Copy link
Owner

This is very odd and looks like some kid of encoding issue.. Can I ask for details on where you're running this? OS and version information?
Also the version of SBCL

@jsulmont
Copy link
Author

jsulmont commented May 7, 2023

@Zulu-Inuoe Yes sorry. I am using the latest SBCL (2.3.4) on MacOS silicon

@Zulu-Inuoe
Copy link
Owner

Okay. Could you share the output at the repl when you eval (map 'list #'char-code "e+-.0123456789") ? It might be that the encoding differs for some reason.

@jsulmont
Copy link
Author

jsulmont commented May 7, 2023

Here:

* (map 'list #'char-code "e+-.0123456789")
(101 43 45 46 48 49 50 51 52 53 54 55 56 57)

@Zulu-Inuoe
Copy link
Owner

Hey @jsulmont thank you so much for reporting this. I had a bad implementation of the printer when writing numbers without exponent or decimal parts. I can't believe I hadn't run into this before, since it's been there from the beginning.
#46
should fix this

@Zulu-Inuoe Zulu-Inuoe self-assigned this Nov 22, 2023
@Zulu-Inuoe Zulu-Inuoe added the bug Something isn't working label Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants