Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
std::modf splits a double into its integer and a fractional part, for example it splits 12.34 into 12 and 0.34.
#include <cmath> |
Screen output:
2.71828 = 2 + 0.718282 |
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.