Basis entryBasics.abs
Static basis
Dynamic basis
Its text in Elm
abs n = if lt n 0 then -n else n
Figure 48: The Values of
Basics Written in ElmTests (2)
- elm-core / FloatAbsTest`abs` on a positive, a negative and a zero `Float`.
- elm-core / IntAbsTest`abs` on an Int returns its magnitude for a positive, a negative and a zero argument.
Discussions
Discuss this basis entry·Search the discussions on GitHub
Discussions are on GitHub; one about this basis entry has [b:Basics.abs] in its title.
A Standard Definition of Elm? (Draft version 0.4) © Rupert Smith. The text is licensed under CC BY 4.0: share and adapt it freely, with credit and a link to the licence.