Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in C only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Today's Posts
Member List
Calendar
Home
Forum
Topic
C
use of modulus operator: how can we use modulus operator with double type variables
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
ksumrani
New Member
Join Date:
Mar 2013
Posts:
1
#1
use of modulus operator: how can we use modulus operator with double type variables
Mar 13 '13, 05:16 PM
how can we use modulus operator with double type variables
weaknessforcats
Recognized Expert
Expert
Join Date:
Mar 2007
Posts:
9214
#2
Mar 13 '13, 06:07 PM
You can't. The modulus operator is for integers only.
Comment
Post
Cancel
whodgson
Contributor
Join Date:
Jan 2007
Posts:
542
#3
Mar 14 '13, 12:43 AM
Well one of my books suggests that fmod() can be used with floats and doubles to obtain a remainder. e.g.:
Code:
cout<<fmod(7.6,2.5);//prints 0.1.
But fmod() is not the % operator as stated above.
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment