main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
792 bytes
|
Line | |
---|
1 | import { curryN } from 'ramda';
|
---|
2 |
|
---|
3 | /**
|
---|
4 | * Converts double-precision 64-bit binary format IEEE 754 to unsigned 32 bit integer number.
|
---|
5 | *
|
---|
6 | * @func toUinteger32
|
---|
7 | * @aliases toUint32
|
---|
8 | * @memberOf RA
|
---|
9 | * @since {@link https://char0n.github.io/ramda-adjunct/2.28.0|v2.28.0}
|
---|
10 | * @category Math
|
---|
11 | * @sig Number -> Number
|
---|
12 | * @param {number} val Value to be converted.
|
---|
13 | * @return {number}
|
---|
14 | * @see {@link RA.toInteger32|toInteger32}, {@link http://speakingjs.com/es5/ch11.html#integers_via_bitwise_operators}
|
---|
15 | * @example
|
---|
16 | *
|
---|
17 | * RA.toUinteger32(1.5); //=> 1
|
---|
18 | * RA.toInteger32(2 ** 35); // => 0
|
---|
19 | * RA.toInteger32(2 ** 31); // => 2147483648
|
---|
20 | * RA.toInteger32(2 ** 30); // => 1073741824
|
---|
21 | */
|
---|
22 |
|
---|
23 | // eslint-disable-next-line no-bitwise
|
---|
24 | const toUinteger32 = curryN(1, (val) => val >>> 0);
|
---|
25 |
|
---|
26 | export default toUinteger32;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.