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
integer division
integer division
Sep 26, 2012 at 5:47pm UTC
closed account (
Ebf21hU5
)
What is the formula you would use for integer division in type double?
Also what formula would you use for modulus? I tried fmod(Op1,Op2) but it wouldn't work in type double.
Sep 26, 2012 at 5:56pm UTC
vlad from moscow
(6539)
int x = 10;
int y = 3;
x = x / y;
double x = 10.0;
double y = 3.0;
x = x / y;
int x = 10;
int y = 3;
x = x % y;
double x = 10.0;
double y = 3.0;
x = fmod( ( long Double )x, ( long double )y );
Topic archived. No new replies allowed.