Need help with an error message lazarus / 13-General ---------------------------------------------------------------------- rturney · 2006-11-20 05:36 Sorry to ask such a basic question, but I haven't programmed in Pascal for a long time and I'm not sure where to look for help.  I need to be able to do math functions like X^Y (X raised to the Y power).  I found a code example on the net and cut and pasted it into a beginning program that I am using to get familiar with Pascal/Lazarus.  Unfortunately the code has generated a warning which I am not sure the cause.  Here's the code: Code: [Select]{Generalized power function by [ts] } {  Some modifications by jds } function GenPowFn(Number, Exponent: real): real;         begin          if (Exponent = 0.0)            then GenPowFn := 1.0            else if Number = 0.0              then GenPowFn := 0.0              else if Abs(Exponent*Ln(Abs(Number))) > 87.498                then RunError(205) {Floating point overflow}                else if Number > 0.0                  then GenPowFn := Exp(Exponent*Ln(Number))                  else if (Number < 0.0) and (Frac(Exponent) = 0.0)                    then if Odd(Round(Exponent))                      then GenPowFn := -GenPowFn(-Number, Exponent)                      else GenPowFn :=  GenPowFn(-Number, Exponent)                    else RunError(207); {Invalid float-op}         end; The warning I'm getting is: Quotekeypressmath1u.pas(57,18) Hint: Type size mismatch, possible loss of data / range check error and is pointing to this line: Code: [Select]else if (Number < 0.0) and (Frac(Exponent) = 0.0) Thanks for any assistance. ---------------------------------------------------------------------- Vincent Snijders · 2006-11-20 15:17 It didn't generate a warning, but a hint. A hint is telling you something you might know and most of the time can safely ignore. I am not sure, but maybe a real is a double (i.e. 64 bits) and 0.0 has the precision of an extended (i.e. 80 bits). Anyway, I would recommend using the power function. ---------------------------------------------------------------------- rturney · 2006-11-21 02:39 Thank you very much.  I didn't realize it was just giving me a hint.  Not used to that.  Also thanks for taking the time to point me to the Power function.