hedgewars/uFloat.pas
changeset 745 43b344488804
parent 744 7a9663194767
child 835 6f567934cc44
equal deleted inserted replaced
744:7a9663194767 745:43b344488804
   292    l:= t.QWordValue;
   292    l:= t.QWordValue;
   293    r:= $100000000
   293    r:= $100000000
   294    end else
   294    end else
   295    begin
   295    begin
   296    l:= $100000000;
   296    l:= $100000000;
   297    r:= t.QWordValue
   297    r:= t.QWordValue div 2 + $80000000 // r:= t / 2 + 0.5 
   298    end;
   298    end;
   299 
   299 
   300 repeat
   300 repeat
   301   c.QWordValue:= (l + r) div 2;
   301   c.QWordValue:= (l + r) div 2;
   302   if hwSqr(c).QWordValue > t.QWordValue then r:= c.QWordValue else l:= c.QWordValue
   302   if hwSqr(c).QWordValue > t.QWordValue then r:= c.QWordValue else l:= c.QWordValue