How would one go about doing this?
How would you handle limits that approach infinity?
e.g. The limit as x goes to 0 of (1/x)
Mathematical Limits in PHP
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Mathematical Limits in PHP
Not sure exactly what your question is? Obviously you cannot divide by zero so you need to put an if() around the calculation and give an appropriate value if the denominator is zero. You can use the math functions to increase the precision, if that is what you need:
http://us.php.net/manual/en/refs.math.php
http://us.php.net/manual/en/refs.math.php
(#10850)
- kaisellgren
- DevNet Resident
- Posts: 1675
- Joined: Sat Jan 07, 2006 5:52 am
- Location: Lahti, Finland.
Re: Mathematical Limits in PHP
If you need to check whether a value is finite, use this http://www.php.net/manual/en/function.is-finite.php
Re: Mathematical Limits in PHP
Computer Algebra Systems (CAS) (and it seems what original poster was asking about) are usually outside what people do in PHP... so your best bet is to find an application that can do what you want and invoke it via shell_exec() and friends.