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

double is a better then real #270

Open
9il opened this issue Jul 4, 2021 · 9 comments
Open

double is a better then real #270

9il opened this issue Jul 4, 2021 · 9 comments

Comments

@9il
Copy link
Member

9il commented Jul 4, 2021

Excess precision cause looses in precision when converted to/form decimal representation. Almost all other non D YAML implementations uses double.

@9il 9il mentioned this issue Jul 6, 2021
@Geod24
Copy link
Member

Geod24 commented Jul 25, 2022

@Herringway : I think that's an issue we should address. real is also much slower than double.

@Herringway
Copy link
Member

Yes, but replacing real with double has different issues. Nodes really shouldn't be using floating point (or other scalar types aside from string) internally.

@Geod24
Copy link
Member

Geod24 commented Jul 25, 2022

So should we just keep the string representation and convert on demand ?

@9il
Copy link
Member Author

9il commented Jul 25, 2022

How would you construct a Node then when you need to convert another format to YAML?

@Herringway
Copy link
Member

So should we just keep the string representation and convert on demand ?

Yes. That would keep the conversions to a minimum and allow values not perfectly representable by floating point types to be preserved between saves/loads.

@Herringway
Copy link
Member

How would you construct a Node then when you need to convert another format to YAML?

It would not be much different than it is now. This may not even need changes to the interface.

@9il
Copy link
Member Author

9il commented Jul 25, 2022

Would you convert floating to string to store it in Node?

@Herringway
Copy link
Member

Would you convert floating to string to store it in Node?

Yes. It would be difficult to write it to the file otherwise.

@9il
Copy link
Member Author

9il commented Jul 26, 2022

Mir has precise number printing that produces the minimal prices decimal form of a given floating point number.

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

Successfully merging a pull request may close this issue.

3 participants