why would we ever want to divide by 0?
authornemo
Wed, 17 Apr 2013 11:24:06 -0400
changeset 8917 263f2a8475bc
parent 8916 71485c03a507
child 8918 512753ea4b1b
why would we ever want to divide by 0?
hedgewars/uFloat.pas
--- a/hedgewars/uFloat.pas	Wed Apr 17 15:45:13 2013 +0400
+++ b/hedgewars/uFloat.pas	Wed Apr 17 11:24:06 2013 -0400
@@ -315,6 +315,7 @@
 operator / (const z1: hwFloat; z2: hwFloat) z : hwFloat; inline;
 var t: hwFloat;
 begin
+if z2.QWordValue = 0 then inc(z2.QWordValue);
 z.isNegative:= z1.isNegative xor z2.isNegative;
 z.Round:= z1.QWordValue div z2.QWordValue;
 t:= z1 - z2 * z.Round;