Why does rem(a, b) function give different answers for input values' class 'double' and 'uint64'?
Show older comments
I define two values as double,
a1 = 9419588158802421600; b1 = 44;
I am trying to use built-in remainder function,
v1 = rem (a1,b1)
output>> v1 = 28
Now, I define the same values but as uint64
a2 = uint64(9419588158802421600); b2 = uint64(44);
and use remainder function
v2 = rem (a2,b2)
output>> v2 = (uint64) 0
Why two different answers are obtained for the same input values?
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!