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

(( calc )) cannot handle large numbers #286

Closed
jhunt opened this issue Apr 8, 2019 · 2 comments
Closed

(( calc )) cannot handle large numbers #286

jhunt opened this issue Apr 8, 2019 · 2 comments

Comments

@jhunt
Copy link
Collaborator

jhunt commented Apr 8, 2019

This is fun:

https://play.spruce.cf/#f22093c2bbbf84230879f13c0d92963e

I expected to get an integer from (( calc )) when only integer operations were involved. Not sure if this is a Go thing, a fmt thing, or a YAML thing, but it sure confuses UAA when it's idle timeouts are specified as non-integers.

@geofffranks
Copy link
Owner

((calc)) is returning float64 values, which get strconv'd into scientific notation from inside the yaml marshaler.

Adding a test to calc to convert float64s that represent ints into int64s to avoid this where it's possible, though if the output of calc is in fact a large float64, it will still get converted into scientific notation.

@geofffranks
Copy link
Owner

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

2 participants