Terry A. Haimann wrote:
Héctor Fiandor Rosario wrote:
Dear Mr. Coppola:
really I solve using this:
var valor1,valor2,valor3:integer;
valor3:=round(power(valor1,valor2));
and declaring the unit "math" in uses.
Thanks very much
Ing. Héctor F. Fiandor
[email protected]
---------------------------------------
Red Telematica de Salud - Cuba
CNICM - Infomed
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
That is fine if raising to an integer power, but if not:
Result := exp((ln(x) * y);
Will give you the correct value for non integer powers. Ok, there is
a small error which is insignificant for all practical purposes.
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
I guess I am wrong, both ways can raise to a non integer power.
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus