The absolute value of self

assert (-10).abs   == 10
assert 10.abs    == 10
assert 0.abs     == 0

Property definitions

core $ Int :: abs
	# The absolute value of self
	#
	#     assert (-10).abs   == 10
	#     assert 10.abs    == 10
	#     assert 0.abs     == 0
	fun abs: Int do return if self >= 0 then self else -self
lib/core/kernel.nit:877,2--882,57