This repository was archived by the owner on Jun 5, 2022. It is now read-only.
File tree 3 files changed +22
-0
lines changed
3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -151,6 +151,16 @@ tan :: Radians -> Number
151
151
152
152
Returns the tangent of the argument.
153
153
154
+ #### ` (%) `
155
+
156
+ ``` purescript
157
+ (%) :: Number -> Number -> Number
158
+ ```
159
+
160
+ _ left-associative / precedence 7_
161
+
162
+ Computes the remainder after division, wrapping Javascript's ` % ` operator.
163
+
154
164
#### ` e `
155
165
156
166
``` purescript
@@ -216,3 +226,4 @@ sqrt2 :: Number
216
226
The square root of two, around 1.41421.
217
227
218
228
229
+
Original file line number Diff line number Diff line change @@ -45,6 +45,12 @@ exports.pow = function (n) {
45
45
} ;
46
46
} ;
47
47
48
+ exports [ "%" ] = function ( n ) {
49
+ return function ( m ) {
50
+ return n % m ;
51
+ } ;
52
+ } ;
53
+
48
54
exports . round = Math . round ;
49
55
50
56
exports . sin = Math . sin ;
Original file line number Diff line number Diff line change @@ -60,6 +60,11 @@ foreign import sqrt :: Number -> Number
60
60
-- | Returns the tangent of the argument.
61
61
foreign import tan :: Radians -> Number
62
62
63
+ infixl 7 %
64
+
65
+ -- | Computes the remainder after division, wrapping Javascript's `%` operator.
66
+ foreign import (%) :: Number -> Number -> Number
67
+
63
68
-- | The base of natural logarithms, *e*, around 2.71828.
64
69
foreign import e :: Number
65
70
You can’t perform that action at this time.
0 commit comments