+ 1

1.25/0.5=2.5 Почему 1.25%0.5=0.25???

12th May 2019, 5:02 AM
Лиза
4 Respostas
+ 1
1.25%0.5=1.25-trunc(1.25/0.5)*0.5; 1.25%0.5=1.25-trunc(2.5)*0.5; 1.25%0.5=1.25-2*0.5; 1.25%0.5=0.25
12th May 2019, 5:30 AM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 1
Daniel Adam It's been 2 weeks but yeah trunc is used in finding remainder.isn't it?
26th May 2019, 11:32 AM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
0
1.25 % 0.5 = 0.25 <-> 1.25 = x * 0.5 + 0.25 (where x is Natural >= 0) The other case is a normal floating point operation division.
12th May 2019, 5:24 AM
Daniel Adam
Daniel Adam - avatar
0
Very_Hard(asm & js & c++ & java & py & (@Hard)) I can not follow your equation .. trunc simply cuts off decimal places.
12th May 2019, 5:47 AM
Daniel Adam
Daniel Adam - avatar