Skip to content

Conversation

@JonSalmon-CC
Copy link

In the following situation, the library does not behave as expected:

constexpr SI::gram_t<uint32_t> mass = 1000_g;

SI::gram_t<uint32_t> half_mass = mass * 0.5f;
cout << half_mass.value(); // Prints out 0!

Without this fix, the library silently down-cast the float to an integer (i.e. zero) before the multiplication. With this fix it won't, although some compilers may warn about the int * float multiplication.

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 this pull request may close these issues.

1 participant