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

Incorrect parsing of floating point numbers without a leading zero #51

Open
ptdecker opened this issue Aug 17, 2020 · 0 comments
Open
Labels
bug workaround A workaround for this defect exists

Comments

@ptdecker
Copy link
Owner

ptdecker commented Aug 17, 2020

The parenthesis are not balancing in:

(define (good-enough? guess x) (< (abs (- (square guess) x)) .001))

But it works in:

(define (good-enough? guess x) (< (abs (- (square guess) x)) 0.001))

Because the floating point number is not being parsed correctly

The workaround for this is to always add a leading zero for floating point constants

@ptdecker ptdecker added the bug label Aug 17, 2020
@ptdecker ptdecker changed the title Parenthesis not balancing Incorrect parsing of floating point numbers without a leading zero Aug 17, 2020
@ptdecker ptdecker added the workaround A workaround for this defect exists label Aug 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug workaround A workaround for this defect exists
Projects
None yet
Development

No branches or pull requests

1 participant