note 100721 deleted from function.pow by hholzgra

From: Date: Thu, 02 Aug 2012 15:31:32 +0000
Subject: note 100721 deleted from function.pow by hholzgra
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-189871@lists.php.net to get a copy of this message
Note Submitter: tagg_maiwald at yahoo dot com ---- This function returns the value of a positive base with a signed floating point exponent: function sf_exp( $fl_x = 1, $fl_y = 0) { $fl_exp = 0.0; if (0 > $fl_x) { // Alter this logic container to enable processing of negative bases. $fl_exp = -1.0; } else { $bool_neg = (0 > $fl_y); if ($bool_neg) { $fl_y = 0 - $fl_y; } $fl_xlog = log10( $fl_x); $fl_xylog = ( $fl_xlog * $fl_y); $fl_exp = pow( 10, $fl_xylog); if ($bool_neg) { $fl_exp = 1/$fl_exp; } } return $fl_exp; }

« previous php.notes (#189871) next »