+ 1

What is the value of=a%b if a=37.5 and b= 3.5

14th Oct 2017, 2:58 PM
Anshika Maurya
Anshika Maurya - avatar
5 odpowiedzi
+ 2
Should be 2.5, but it turn out "invalid operands of types 'float' and 'float' to binary 'operator%' "
14th Oct 2017, 3:05 PM
Oleg
Oleg - avatar
+ 1
test it the result 2.5
14th Oct 2017, 3:08 PM
MBZH31
MBZH31 - avatar
+ 1
modulo operator throws error for floating point and double Data type
14th Oct 2017, 4:35 PM
Nanda Balakrishnan
0
no error with python
14th Oct 2017, 4:37 PM
MBZH31
MBZH31 - avatar
0
ya in python it is working fine but in java and c++ will throw error
14th Oct 2017, 4:43 PM
Nanda Balakrishnan