I am stuck in finding checking whether a variable has value equal to an integer not. The given are the MALAB commands. The variable cc
has value 1.0000
and I am checking whether its remainder is zero or not. it should be zero but it gives 1
. Why doesn't this give 0
?
>> cc
cc =
1.0000
>> rem(cc,1)
ans =
1.0000
>> rem(1.0000,1)
ans =
0
>> mod(1.0000,1)
ans =
0
>> mod(cc,1)
ans =
1.0000
>> mod(1.0000,1)
mod(cc,1)