This repository was archived by the owner on Jun 5, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -151,6 +151,16 @@ tan :: Radians -> Number
151151
152152Returns the tangent of the argument.
153153
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+
154164#### ` e `
155165
156166``` purescript
@@ -216,3 +226,4 @@ sqrt2 :: Number
216226The square root of two, around 1.41421.
217227
218228
229+
Original file line number Diff line number Diff line change @@ -45,6 +45,12 @@ exports.pow = function (n) {
4545 } ;
4646} ;
4747
48+ exports [ "%" ] = function ( n ) {
49+ return function ( m ) {
50+ return n % m ;
51+ } ;
52+ } ;
53+
4854exports . round = Math . round ;
4955
5056exports . sin = Math . sin ;
Original file line number Diff line number Diff line change @@ -60,6 +60,11 @@ foreign import sqrt :: Number -> Number
6060-- | Returns the tangent of the argument.
6161foreign import tan :: Radians -> Number
6262
63+ infixl 7 %
64+
65+ -- | Computes the remainder after division, wrapping Javascript's `%` operator.
66+ foreign import (%) :: Number -> Number -> Number
67+
6368-- | The base of natural logarithms, *e*, around 2.71828.
6469foreign import e :: Number
6570
You can’t perform that action at this time.
0 commit comments