cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
% not usable on double options?
% not usable on double options?
Mar 23, 2021 at 6:56pm UTC
domweng
(43)
I now understand % is not usable on double values, is there anyway around this because if I set the variable to an integer type my whole code messes up.
1
2
3
4
if
(counter % 5 != 0) { cout << setw(15) << counter << setw(15) << fallDist << endl; }
Mar 23, 2021 at 7:39pm UTC
dutch
(2548)
Possibly
https://en.cppreference.com/w/cpp/numeric/math/fmod
But it really sounds like a design problem.
Topic archived. No new replies allowed.