mod function return wrong answer?
4 views (last 30 days)
Show older comments
How can I make sure mod(a,b) returns value less than b, without explicitly calling min( mod(a,b), b )?
mod( -eps, 1 ) = 1 when eps ~ 10^-17.
Numerical accuracy is not an issue, but I need mod( a, 1 ) be less than 1.
3 Comments
madhan ravi
on 5 Jul 2020
Edited: madhan ravi
on 5 Jul 2020
Sindar I suggest moving your comment as an answer
Answers (1)
See Also
Categories
Find more on Matrix Indexing 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!