From a4189bd7fd8aa59750171df5066edca37888c95e Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sun, 5 Dec 2004 16:52:34 +0000 Subject: [PATCH] * also invalid argument if trying to calculate 0^0 with intpower() --- rtl/objpas/math.pp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rtl/objpas/math.pp b/rtl/objpas/math.pp index 588175c43b..f0a5f71c32 100644 --- a/rtl/objpas/math.pp +++ b/rtl/objpas/math.pp @@ -640,6 +640,8 @@ function intpower(base : float;const exponent : Integer) : float; i : longint; begin + if (base = 0.0) and (exponent = 0) then + InvalidArgument; i:=abs(exponent); intpower:=1.0; while i>0 do @@ -1342,7 +1344,10 @@ end; end. { $Log$ - Revision 1.25 2004-12-05 16:43:57 jonas + Revision 1.26 2004-12-05 16:52:34 jonas + * also invalid argument if trying to calculate 0^0 with intpower() + + Revision 1.25 2004/12/05 16:43:57 jonas * fixed power() in genmath.inc (code duplication from math.pp for ** support!) * fixed power() in math.pp to give an error from 0^0