Stooney Posted March 26, 2007 Share Posted March 26, 2007 i have the following formula: $rating = -(ln(($points/2894) - 1) - 5.56)/0.0025; that formula is the reverse engineer of another one i had someone do, I dont personally know the math. According to him the ln "is the natural logarithm. i.e. log to the base e." whatever that means. Anyone know what a php alternative for this 'ln' is? Link to comment https://forums.phpfreaks.com/topic/44376-using-math-ln-in-php/ Share on other sites More sharing options...
kenrbnsn Posted March 26, 2007 Share Posted March 26, 2007 PHP has a natural logarithm function named log(), so the line would be written: <?php $rating = -(log(($points/2894) - 1) - 5.56)/0.0025; ?> Ken Link to comment https://forums.phpfreaks.com/topic/44376-using-math-ln-in-php/#findComment-215506 Share on other sites More sharing options...
Stooney Posted March 26, 2007 Author Share Posted March 26, 2007 im getting 'NAN' with the following: $nrating = -(log(($goal/2894) - 1) - 5.56)/0.0025; i made sure that $goal is getting a value. (i used 600) am i missing something? Link to comment https://forums.phpfreaks.com/topic/44376-using-math-ln-in-php/#findComment-215517 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.