Source code untuk fungsi pow?

H

hoangnc

Guest
Saya harus menulis fungsi seperti pow (double pow (double x, double y)).Siapa pun memiliki kode sumber ini?

 
pow adalah fungsi matematika!Dalam perpustakaan standar, ada prototipe-nya!

 
Jika Anda benar-benar membutuhkan ...Anda dapat menggunakan fakta ini:

X ^ Y <=> e ^ (ln (X ^ Y)) <=> e ^ (Y * ln (X))

PASCAL / Delphi:

fungsi Pow (aBasis: integer; aExponent: byte): integer;
mulai Pow: = Trunc (Exp (aExponent * Ln (aBasis))); end;

Tihi

<img src="http://www.edaboard.com/images/smiles/icon_cool.gif" alt="Dingin" border="0" />
 

Welcome to EDABoard.com

Sponsor

Back
Top