how to write this in PHP???

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
apek
Forum Commoner
Posts: 96
Joined: Tue Jan 06, 2004 11:19 pm
Location: Holiday Plaza Johor Bahru

how to write this in PHP???

Post by apek »

i dont know how to write this in PHP..
and i dont know how to write this here because its a mathematical equation....with power,negative and exponen...
pls help..how to write this here???
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

Post by pelegk2 »

what are utalking about
give numbers example
User avatar
apek
Forum Commoner
Posts: 96
Joined: Tue Jan 06, 2004 11:19 pm
Location: Holiday Plaza Johor Bahru

Post by apek »

but i try to write this as clear as i can..

e (with power by negative i*t)

with i and t is a variable...
and e is exponent...
User avatar
scorphus
Forum Regular
Posts: 589
Joined: Fri May 09, 2003 11:53 pm
Location: Belo Horizonte, Brazil
Contact:

Post by scorphus »

Code: Select all

<?php
$i = 1;
$t = 2;
echo exp(-$i * $t);
?>
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

There's examples at :
http://php.net/exp and
http://php.net/pow
User avatar
apek
Forum Commoner
Posts: 96
Joined: Tue Jan 06, 2004 11:19 pm
Location: Holiday Plaza Johor Bahru

Post by apek »

if pow(2,8) means a i want to raise the two with the power 8..
how to raise the exponen with the power -i*t??


is this true??

Code: Select all

pow(exp,-$MTTF*$bilInspection)
User avatar
scorphus
Forum Regular
Posts: 589
Joined: Fri May 09, 2003 11:53 pm
Location: Belo Horizonte, Brazil
Contact:

Post by scorphus »

Please read my post a bit above... thanks.

Scorphus.
User avatar
apek
Forum Commoner
Posts: 96
Joined: Tue Jan 06, 2004 11:19 pm
Location: Holiday Plaza Johor Bahru

Post by apek »

i read it..
but theres no pow is written there..
in my equation,theres power involve...
User avatar
scorphus
Forum Regular
Posts: 589
Joined: Fri May 09, 2003 11:53 pm
Location: Belo Horizonte, Brazil
Contact:

Post by scorphus »

scorphus@Kilauea:/tmp$ cat tmp.php

Code: Select all

<?php
$i = 1;
$t = 2;
echo exp(-$i * $t) . "\n";
echo exp(0) . "\n";
echo exp(1) . "\n";
echo exp(2) . "\n";
?>
scorphus@Kilauea:/tmp$ php tmp.php

Code: Select all

0.135335283237
1
2.71828182846
7.38905609893
scorphus@Kilauea:/tmp$
Post Reply