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

Compact output is not compact enough #44

Closed
relet opened this issue Nov 14, 2012 · 1 comment
Closed

Compact output is not compact enough #44

relet opened this issue Nov 14, 2012 · 1 comment

Comments

@relet
Copy link

relet commented Nov 14, 2012

I would like to have an option (-cc ?) that actually minifies the output. Strip whitespace, print integer-ish numbers as integer, possibly specify float precision.

@stedolan
Copy link
Contributor

I'll add an option to remove whitespace, or maybe just make the existing -c do that. Numbers are already printed as small as they can be - the rendered text is the shortest string which, after round-to-nearest-double, produces the original input.

So, integers are already printed as integers. If you divide 1 by 10, the internal double is actually about

0.10000000000000000555

However, the string "0.1" is shorter and rounds to the same double value, so that's printed instead. (this isn't my code, go look at dtoa.c on netlib if you want wayyyyy too many details).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants