Re: how to capture INF return from exp()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 9, 2010 at 11:00, Info <1888software@xxxxxxxxx> wrote:
> Hello List,
> I am using the math function exp( $arg )
>
> http://php.net/exp
>
> ... using argument values ranging between 0 to 1500.
>
> When I get into larger numbers, such as 750, the function returns an
> undocumented "INF".
> Presumably the "INF" means the number exceeds processing capacity. It would
> be nice to know the official explanation.
>
> At any rate, I want to capture the "INF" so that I can indicate to my users,
> in a friendlier manner, that capacity is exceeded.
>
> How?
>
> Please also cc my address on your reply, with thanks,
>
> Sincerely,
> Esteban
>
> 1888Software.com S.A.
> Software Powers the Net
> WWW: http://1888Software.com
> Email: 1888Software@xxxxxxxxx
>

You can use the is_infinite() function. It's not entirely undocumented
though. See http://php.net/float. Basically you'll get INF when you
exceed the range according to the IEEE floating point standard.

-- 
Daniel Egeberg

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux