on master help sign in
Add negate function
b4850a2Evan Czaplicki
changelog.md+1
@@ -8,6 +8,7 @@
8 * Add Debug.crash
8 * Add Debug.crash
9 * Add List.indexedMap and List.filterMap
9 * Add List.indexedMap and List.filterMap
10 * Add Maybe.map
10 * Add Maybe.map
11+ * Add Basics.negate
11 * Add --bundle-runtime flag which creates stand-alone Elm programs
12 * Add --bundle-runtime flag which creates stand-alone Elm programs
12 * Error on ambiguious use of imported variables
13 * Error on ambiguious use of imported variables
13 * Replace dependency on Pandoc with cheapskate+kate
14 * Replace dependency on Pandoc with cheapskate+kate
libraries/Basics.elm+5−1
@@ -22,7 +22,7 @@ are your tuples so big?
22@docs not, (&&), (||), xor, otherwise
22@docs not, (&&), (||), xor, otherwise
23
23
24# Mathematics
24# Mathematics
25−@docs (+), (-), (*), (/), (^), (//), rem, (%), abs, sqrt, clamp, logBase, e
25+@docs (+), (-), (*), (/), (^), (//), rem, (%), negate, abs, sqrt, clamp, logBase, e
26
26
27# Trigonometry
27# Trigonometry
28@docs pi, cos, sin, tan, acos, asin, atan, atan2
28@docs pi, cos, sin, tan, acos, asin, atan, atan2
@@ -161,6 +161,10 @@ atan2 = Native.Basics.atan2
161sqrt : Float -> Float
161sqrt : Float -> Float
162sqrt = Native.Basics.sqrt
162sqrt = Native.Basics.sqrt
163
163
164+{-| Negate any number: `negate 42 == -42` -}
165+negate : number -> number
166+negate n = -n
167+
164{-| Take the absolute value of a number. -}
168{-| Take the absolute value of a number. -}
165abs : number -> number
169abs : number -> number
166abs = Native.Basics.abs
170abs = Native.Basics.abs