on master help sign in
Fix #769, stop using infix ops that are not filled in properly
aa00bf8Evan Czaplicki
libraries/Basics.elm+2−2
@@ -163,11 +163,11 @@ sqrt = Native.Basics.sqrt
163
163
164{-| Negate any number: `negate 42 == -42` -}
164{-| Negate any number: `negate 42 == -42` -}
165negate : number -> number
165negate : number -> number
166−negate n = -n
166+negate = Native.Basics.negate
167
167
168{-| Take the absolute value of a number. -}
168{-| Take the absolute value of a number. -}
169abs : number -> number
169abs : number -> number
170−abs n = if n < 0 then -n else n
170+abs = Native.Basics.abs
171
171
172{-| Calculate the logarithm of a number with a given base: `logBase 10 100 == 2` -}
172{-| Calculate the logarithm of a number with a given base: `logBase 10 100 == 2` -}
173logBase : Float -> Float -> Float
173logBase : Float -> Float -> Float
libraries/Native/Basics.js+8
@@ -18,6 +18,12 @@ Elm.Native.Basics.make = function(elm) {
18 function logBase(base, n) {
18 function logBase(base, n) {
19 return Math.log(n) / Math.log(base);
19 return Math.log(n) / Math.log(base);
20 }
20 }
21+ function negate(n) {
22+ return -n;
23+ }
24+ function abs(n) {
25+ return n < 0 ? -n : n;
26+ }
21
27
22 function min(a, b) {
28 function min(a, b) {
23 return Utils.cmp(a,b) < 0 ? a : b;
29 return Utils.cmp(a,b) < 0 ? a : b;
@@ -82,6 +88,8 @@ Elm.Native.Basics.make = function(elm) {
82
88
83 sqrt: Math.sqrt,
89 sqrt: Math.sqrt,
84 logBase: F2(logBase),
90 logBase: F2(logBase),
91+ negate: negate,
92+ abs: abs,
85 min: F2(min),
93 min: F2(min),
86 max: F2(max),
94 max: F2(max),
87 clamp: F3(clamp),
95 clamp: F3(clamp),