Basis entryBasics.clamp
Static basis
Dynamic basis
Its APPLY
Tests (3)
- elm-core / BasicsClampTest`clamp 5 10` returns the lower bound for 3, the value itself for 7 and the upper bound for 15, and `clamp 1.0 5.0` leaves 3.5 unchanged.
- elm-core / CoreIssue1080ClampNanTest`clamp -100 100` of NaN returns NaN.
- elm-core / StandardA49ClampTest`clamp lo hi x`: at Float it is `min (max x lo) hi`, with the IEEE 754 `maximum` and `minimum` that propagate NaN and order `-0` below `+0`; at Int it is the text of elm/core.
Discussions
Discuss this basis entry·Search the discussions on GitHub
Discussions are on GitHub; one about this basis entry has [b:Basics.clamp] 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.