File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44var Constants = { } ;
55
6+ function equal ( a , b ) {
7+ return a === b ;
8+ }
9+
10+ function compare ( a , b ) {
11+ if ( a === b ) {
12+ return 0 ;
13+ } else if ( a > b ) {
14+ return 1 ;
15+ } else {
16+ return - 1 ;
17+ }
18+ }
19+
620function fromString ( i ) {
721 var i$1 = parseFloat ( i ) ;
822 if ( isNaN ( i$1 ) ) {
@@ -14,6 +28,8 @@ function fromString(i) {
1428
1529export {
1630 Constants ,
31+ equal ,
32+ compare ,
1733 fromString ,
1834}
1935/* No side effect */
Original file line number Diff line number Diff line change @@ -7,6 +7,17 @@ module Constants = {
77 @val external maxValue : float = "Number.MAX_VALUE"
88}
99
10+ let equal = (a : float , b : float ) => a === b
11+
12+ let compare = (a : float , b : float ) =>
13+ if a === b {
14+ 0
15+ } else if a > b {
16+ 1
17+ } else {
18+ - 1
19+ }
20+
1021@val external isNaN : float => bool = "isNaN"
1122@val external isFinite : float => bool = "isFinite"
1223@val external parseFloat : 'a => float = "parseFloat"
Original file line number Diff line number Diff line change @@ -109,6 +109,10 @@ module Constants: {
109109 external maxValue : float = "Number.MAX_VALUE"
110110}
111111
112+ let equal : (float , float ) => bool
113+
114+ let compare : (float , float ) => int
115+
112116/**
113117`isNaN(v)` tests if the given `v` is `NaN`.
114118See [`NaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN) on MDN.
You can’t perform that action at this time.
0 commit comments