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

[fb] Do not use float #72

Closed
craigsapp opened this issue Mar 14, 2023 · 0 comments · Fixed by #73
Closed

[fb] Do not use float #72

craigsapp opened this issue Mar 14, 2023 · 0 comments · Fixed by #73

Comments

@craigsapp
Copy link
Owner

For @WolfgangDrescher:

In the fb tool, there are two uses of float, when double would be more appropriate. float is 32-bits and doubles are 64-bits, so on 64-bit computers it is always better to use double rather than float just for runtime speed reasons, unless there is a specific reason to use float (which does not exist in this case).

In linux/MacOS, there are no compiler warnings about this. But in Windows, there is a complaint(since you are losing some resolution by converting to a smaller storage size):

         C:\projects\humlib\src\tool-fb.cpp(383): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data [C:\projects\humlib\build\humlib.vcxproj]
         C:\projects\humlib\src\tool-fb.cpp(384): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data [C:\projects\humlib\build\humlib.vcxproj]
         C:\projects\humlib\src\tool-fb.cpp(389): warning C4244: '=': conversion from 'double' to 'float', possible loss of data [C:\projects\humlib\build\humlib.vcxproj]
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.

1 participant