Jump to content

Archived

This topic is now archived and is closed to further replies.

Stooney

using math 'ln' in php

Recommended Posts

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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.