[erlang-questions] Inf, NaN, and -Inf

Tom Burdick <>
Mon Feb 27 18:07:53 CET 2012


So in python and C to find the biggest and smallest number in a list
of floating point numbers I'd do something like a lists:foldl and
simply give it

inf and -inf respectively as the values to compare against, or better
yet use some built in defines or variables defining what the min and
max values for a particular number type are.

Is there some sane way to do this in erlang? Is there a way to get the
floating point values inf and -inf in erlang or the maximal and
minimal values for integers and floats in erlang? I didn't see it in
my hunt around the documentation perhaps I just missed it.

Thanks!

Tom



More information about the erlang-questions mailing list