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

ice_point definition is (very very slightly) incorrect #539

Closed
chiphogg opened this issue Dec 28, 2023 · 0 comments
Closed

ice_point definition is (very very slightly) incorrect #539

chiphogg opened this issue Dec 28, 2023 · 0 comments
Labels
bug Something isn't working refactor Modify existing code potentially causing breaking changes

Comments

@chiphogg
Copy link
Collaborator

I didn't want to hijack #537, but I noticed this line in it:

inline constexpr struct ice_point : relative_point_origin<quantity_point{273.15 * kelvin}> {} ice_point;

The correct definition would set the value to 273.15. This definition sets it to the representable double precision floating point number that is closest to 273.15. Although the difference is extremely tiny, it is enough to prevent valid integer-type-only use cases that use exact reasoning (for example, converting between millikelvins and millidegrees Celsius).

I'm not sure about the absolute best way to proceed, but I bet it would be good to use an integer to define this value rather than floating point.

@mpusz mpusz added the refactor Modify existing code potentially causing breaking changes label Dec 29, 2023
@mpusz mpusz added the bug Something isn't working label Jan 5, 2024
@mpusz mpusz closed this as completed in 5382fdb Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working refactor Modify existing code potentially causing breaking changes
Projects
None yet
Development

No branches or pull requests

2 participants