hedgewars/uFloat.pas
changeset 15925 d2dafe1b25f5
parent 15775 72f735c03fec
child 15929 128ace913837
equal deleted inserted replaced
15923:9b8d4f34e0f3 15925:d2dafe1b25f5
   296 
   296 
   297 
   297 
   298 operator * (const z1, z2: hwFloat) z : hwFloat; inline;
   298 operator * (const z1, z2: hwFloat) z : hwFloat; inline;
   299 begin
   299 begin
   300     z.isNegative:= z1.isNegative xor z2.isNegative;
   300     z.isNegative:= z1.isNegative xor z2.isNegative;
   301     z.QWordValue:= QWord(z1.Round) * z2.Frac + QWord(z1.Frac) * z2.Round + ((QWord(z1.Frac) * z2.Frac) shr 32);
   301     
   302     z.Round:= z.Round + QWord(z1.Round) * z2.Round;
   302     if (z1.Round = 0) and (z2.Round = 0) then
       
   303         begin
       
   304         z.QWordValue:= (QWord(z1.Frac) * z2.Frac) shr 32;
       
   305         end 
       
   306     else
       
   307         begin
       
   308         z.QWordValue:= QWord(z1.Round) * z2.Frac + QWord(z1.Frac) * z2.Round + ((QWord(z1.Frac) * z2.Frac) shr 32);
       
   309         z.Round:= z.Round + QWord(z1.Round) * z2.Round;
       
   310     end
   303 end;
   311 end;
   304 
   312 
   305 operator * (const z1: hwFloat; const z2: LongInt) z : hwFloat; inline;
   313 operator * (const z1: hwFloat; const z2: LongInt) z : hwFloat; inline;
   306 begin
   314 begin
   307     z.isNegative:= z1.isNegative xor (z2 < 0);
   315     z.isNegative:= z1.isNegative xor (z2 < 0);