Is the float an infinite value

this function returns:

  • 1 if self is positive infinity
  • -1 if self is negative infinity
  • 0 otherwise
assert 10.0.is_inf == 0
assert inf.is_inf == 1
assert (-inf).is_inf == -1

Property definitions

core :: math $ Float :: is_inf
	# Is the float an infinite value
	# this function returns:
	#
	#  * 1 if self is positive infinity
	#  * -1 if self is negative infinity
	#  * 0 otherwise
	#
	# ~~~
	# assert 10.0.is_inf == 0
	# assert inf.is_inf == 1
	# assert (-inf).is_inf == -1
	# ~~~
	fun is_inf: Int do
		if native_is_inf then
			if self < 0.0 then return -1
			return 1
		end
		return 0
	end
lib/core/math.nit:315,2--333,4