473,399 Members | 2,278 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

math formula

I am trying to put the following math formula in php, but I know to little
of math to do it I guess, maybe somebody can help me out.

This is the formula:

x = (-ln(1) - ln(y/100))*100*z

The values for y and z will be submitted via a form.
Any help is greatly apreciated.

Wim
Jul 17 '05 #1
5 6433
On 2005-04-08, Wim Smit <wi*@vdhosting.nl> wrote:
I am trying to put the following math formula in php, but I know to little
of math to do it I guess, maybe somebody can help me out.

This is the formula:

x = (-ln(1) - ln(y/100))*100*z

The values for y and z will be submitted via a form.
Any help is greatly apreciated.


Start by learning how to submit a variable through a form. Then move on
to processing the variable. The PHP manual will tell you how to do this.

--
Cheers
- Jacob Atzen
Jul 17 '05 #2
Wim Smit wrote:
I am trying to put the following math formula in php, but I know to little
of math to do it I guess, maybe somebody can help me out.

This is the formula:

x = (-ln(1) - ln(y/100))*100*z

The values for y and z will be submitted via a form.
Any help is greatly apreciated.

Wim


The PHP function for natural logarithms is log(), not ln(). Variable names
start with a $ symbol, e.g.:

$x = $_GET['x'];
$y = $_GET['y'];

Fix that, put a semicolon at the end and it should work.

BTW, ln(1) is equal to zero, so you can delete it from your equation.

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/
Jul 17 '05 #3
Thanks for the quick reply.

I tried to use this code now:

$x = (- log(1) - log(0.06/100))*100*673356;

The value of $x is 499534596.235
However the value of $x should be 4645225.

U sure log() in PHP does the same as ln()?

Wim
"Philip Ronan" <in*****@invalid.invalid> schreef in bericht
news:BE7C1758.2E294%in*****@invalid.invalid...
Wim Smit wrote:
I am trying to put the following math formula in php, but I know to
little
of math to do it I guess, maybe somebody can help me out.

This is the formula:

x = (-ln(1) - ln(y/100))*100*z

The values for y and z will be submitted via a form.
Any help is greatly apreciated.

Wim


The PHP function for natural logarithms is log(), not ln(). Variable names
start with a $ symbol, e.g.:

$x = $_GET['x'];
$y = $_GET['y'];

Fix that, put a semicolon at the end and it should work.

BTW, ln(1) is equal to zero, so you can delete it from your equation.

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/

Jul 17 '05 #4
Submitting a variable won't be the problem, it is getting PHP to do the
formula correctly.
ln() does not show up in the manual, likely there is a way around that, but
I know to little of math on how to solve that. :).

Wim
"Jacob Atzen" <ja***@aub.dk> schreef in bericht
news:sl*******************@tank.aub.dk...
On 2005-04-08, Wim Smit <wi*@vdhosting.nl> wrote:
I am trying to put the following math formula in php, but I know to
little
of math to do it I guess, maybe somebody can help me out.

This is the formula:

x = (-ln(1) - ln(y/100))*100*z

The values for y and z will be submitted via a form.
Any help is greatly apreciated.


Start by learning how to submit a variable through a form. Then move on
to processing the variable. The PHP manual will tell you how to do this.

--
Cheers
- Jacob Atzen

Jul 17 '05 #5
Wim Smit wrote:
Thanks for the quick reply.

I tried to use this code now:

$x = (- log(1) - log(0.06/100))*100*673356;

The value of $x is 499534596.235
That is correct
However the value of $x should be 4645225.
That is incorrect

U sure log() in PHP does the same as ln()?


log() is a natural logarithm function. That's what you want, isn't it?

Use log10() if you want base 10 logarithms

Take a look at <http://uk.php.net/log> and <http://uk.php.net/log10>

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/
Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Frank Millman | last post by:
Hi all I was helping my niece with her trigonometry homework last night. Her calculator's batteries were flat, so I thought I would use Python's math module to calculate sin, cos, and tan. I...
17
by: cwdjrxyz | last post by:
Javascript has a very small math function list. However there is no reason that this list can not be extended greatly. Speed is not an issue, unless you nest complicated calculations several levels...
4
by: Sehri | last post by:
Hi all, I have just started developing a math companion tool with VS2005 and I just ran into a problem when trying to add the description of a formula. Doed anyone know how can I add math...
12
by: Woody Splawn | last post by:
I am trying to determine the age of a person based on two dates, the Date of Birth and Today(). I have a function that does this but it is kludgey and is giving me an age that is pretty close...
0
by: kirby.urner | last post by:
Cyber-curricula have a leveling aspect, as kids nearer Katrina's epicenter tune in and bliss out on 'Warriors of the Net' (why wait for stupid big dummy textbooks to catch up?). They feel more...
10
by: Joseph Geretz | last post by:
I need to calculate miles per degree longitude, which obviously depends on latitude since lines of longitude converge at the poles. Via Google, I've come up with the following calculation: ...
15
by: lbrtchx | last post by:
I am trying to write up a page with Math formulas (statistical ones) ~ http://www.geocities.com/tekmonk2005/OnLineStats02.html ~ The thing is that I am not able to make it look OK using HTML. I...
1
by: Michael Fesser | last post by:
..oO(SM) <?php $itemsPerGroup = 10; $itemPosition = 12; $group = ceil($itemPosition/$itemsPerGroup); var_dump($group); ?>
17
by: Lenni | last post by:
Hi, I'm currently writing a web application for bicycle wheel builders that calculate the spoke length for all sorts of variations of hubs and rims. I have translated the formula from an...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.