PHP: is_infinite - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

is_nan is_finite

Last updated: Fri, 26 Jan 2007

view this page in

# is_infinite

(PHP 4 >= 4.2.0, PHP 5)

is_infinite -- Finds whether a value is infinite

## Description

bool is_infinite ( float val )

Returns `TRUE` if `val` is infinite (positive or negative), like the result of `log(0)` or any value too big to fit into a float on this platform.

See also is_finite() and is_nan().

add a note User Contributed Notes
is_infinite
21-Aug-2006 08:54
`@ david,
That will return true for any string ending with "INF".
I think substr("$value",0,3) would be more appropriate.`
david(@t)nirvanis(d@t)org
31-Aug-2004 02:49
`If you have PHP lower than 4.2 you can simulate the behaviour:
function is_infinite($value) {
return (substr("$value",-3) == "INF");
}
(tested on php 4.1.2)`
add a note
is_nan is_finite

Last updated: Fri, 26 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 09:32:46 2007 PST