Hello,
I need a function which returns the fraction part of a number.
I mean if the input to the function is 5.678, I need the output to be 0.678.
Is there a built in function to do so in C++?
Thank you
arian
This is a discussion on a function to return fraction within the C++ Programming forums, part of the General Programming Boards category; Hello, I need a function which returns the fraction part of a number. I mean if the input to the ...
Hello,
I need a function which returns the fraction part of a number.
I mean if the input to the function is 5.678, I need the output to be 0.678.
Is there a built in function to do so in C++?
Thank you
arian
You could #include <cmath> and use std::fmod.
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way
Thanks![]()