**New course!**Every coder should learn

**Generative AI!**

+ 3

# The remainder when 1.25 is divided by 0.5 is 0.25.

Whe I use a calculator to get the remainder of 1.25 divided by 0.5 the results is 2.5, can any one explain me this.

6 Answers

+ 8

0.5 divides 1.25 to get 2.5. There is no remainder involved in this division, unless you are talking about floor division (//), where 1.25 // 0.5 = 2 ... 0.25.
Some read on modular arithmetic on floating-point values:
https://stackoverflow.com/questions/6102948/why-does-modulus-division-only-work-with-integers

+ 4

I think you have done division (//) not remainder (%).
now, 1.25÷0.5
= 125÷50
=2.5 thats the answer.
but if you have to find remainder then, yes answer should be 0.25 .

+ 3

its simple--> see
1.25//0.5=2
1.25%0.5 = 1.25-0.5*2 = 1.25-1 = 0.25
pure maths....dont get cofused
1.25/0.5
= (1 + 0.25) / 0.5
= (1 / /0.5) +(1%0.5) + (0.25 //0.5) + (0.25%0.5) [ 0.25 here is the remainder ; when you again devide it with 0.5 it results 0.5]
= 2 +0+ 0+0.25/0.5(as remainder in 0.25%0
5 is not zero so we have to do division)
=2+0.5
##// REMEMBER // ##
3 OPERATORS-->
(% ) GIVES ONLY REMAINDER
(//) GIVES PURE DIVISION VALUE (5//2= 2)
(/ ) GIVES ULTUMATE DIVISION (5/2=2.5)

0

how come 1.25//0.5=2???? other steps is cleared this only difficult to me....plsss help me

0

Since 1.25 % 0.5 As we want to calculate remainder or Modulo-Operator.So,
0.5x2=1 2 which is the quotient
1.25-1= 0.5 which is remainder

- 1

@JEEVANANDHAMS---->>
// is the pure division operator giving only integer value...
1 . 25 // 0 . 5 = 125//50=int(2 . 5)= 2
IF U DO 1 . 25 / 0 . 5 = 2 . 5