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

Always add implicit + for exponent part of floating point literals #13

Open
fredrikekre opened this issue Jul 5, 2024 · 2 comments
Open

Comments

@fredrikekre
Copy link
Owner

For example:

-1.2e5
+1.2e+5
@pjaap
Copy link

pjaap commented Jan 2, 2025

I thought about this question for a while and I think it is better not to add (enforce) a + for positive exponents.
My arguments are:

  • It does not show up anywhere in articles about scientific notation (e.g., Wikipedia, Julia Doc for FP Numbers)
  • Julia's display of floating point numbers does not use + (we would have inconsistency with copy&paste of values)

Some counterarguments:

  • Julia's BigFloat uses +
  • It aligns well with the mantadory - for negative exponents

Are there any other intentions I am missing?

@fredrikekre
Copy link
Owner Author

Yea you are probably right.

It aligns well with the mantadory - for negative exponents

This was my main motivation for this issue but leaving it up to the author to include or not is probably good enough (e.g. if you want to align numbers with positive and negative exponents etc).

Julia's BigFloat uses +

I wonder if that should be removed actually, I don't see why it should print differently from doubles.

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