Modulo with expression not the same as modulo with value
이전 댓글 표시
Why does mod(1, Y-X) not approximately equal 0?
mod(1, 0.1)
X = 2;
Y = 2.1;
Y - X
mod(1, Y - X)
I realize that Y - X ~= 0.1 but
isapprox(Y - X, 0.1, "loose")
therefore, why not
isapprox(mod(1, Y - X), 0, "loose")
My guess is that it is either something to do with floating point precision or the fact that it is an expression vs. a value?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
