File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -277,7 +277,37 @@ module Int: {
277
277
@val
278
278
external sign : int => int = "Math.sign"
279
279
280
+ /**
281
+ floor(v) returns the largest `int` less than or equal to the argument;
282
+ the result is pinned to the range of the `int` data type: -2147483648 to 2147483647.
283
+ See [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)
284
+ on MDN.
285
+
286
+ ## Examples
287
+
288
+ ```rescript
289
+ Math.Int.floor(3.7) == 3
290
+ Math.Int.floor(3.0) == 3
291
+ Math.Int.floor(-3.1) == -4
292
+ Math.Int.floor(-1.0e15) == -2147483648
293
+ Math.Int.floor(1.0e15) == 2147483647
294
+ ```
295
+ */
280
296
let floor : float => int
297
+
298
+ /**
299
+ `random(minVal, maxVal)` returns a random integer number in the half-closed interval [minVal, maxVal).
300
+ See [`Math.random`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random)
301
+ on MDN.
302
+
303
+ ## Examples
304
+
305
+ ```rescript
306
+ Math.Int.random(2, 5) == 4
307
+ Math.Int.random(505, 2000) == 1276
308
+ Math.Int.random(-7, -2) == -4
309
+ ```
310
+ */
281
311
let random : (int , int ) => int
282
312
}
283
313
You can’t perform that action at this time.
0 commit comments