@woosh/meep-engine 2.121.5 → 2.121.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/core/math/frexp.d.ts
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* Similar to C's frexp function.
|
|
4
4
|
* @param {number} value - The floating-point number to decompose
|
|
5
5
|
* @param {number[]} exponent where to write exponent to
|
|
6
|
+
* @param {number} [offset_into_exponent]
|
|
6
7
|
* @returns {number} mantissa
|
|
7
8
|
*/
|
|
8
|
-
export function frexp(value: number, exponent: number[]): number;
|
|
9
|
+
export function frexp(value: number, exponent: number[], offset_into_exponent?: number): number;
|
|
9
10
|
//# sourceMappingURL=frexp.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frexp.d.ts","sourceRoot":"","sources":["../../../../src/core/math/frexp.js"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"frexp.d.ts","sourceRoot":"","sources":["../../../../src/core/math/frexp.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,6BALW,MAAM,YACN,MAAM,EAAE,yBACR,MAAM,GACJ,MAAM,CAqClB"}
|
package/src/core/math/frexp.js
CHANGED
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
* Similar to C's frexp function.
|
|
4
4
|
* @param {number} value - The floating-point number to decompose
|
|
5
5
|
* @param {number[]} exponent where to write exponent to
|
|
6
|
+
* @param {number} [offset_into_exponent]
|
|
6
7
|
* @returns {number} mantissa
|
|
7
8
|
*/
|
|
8
|
-
export function frexp(value, exponent) {
|
|
9
|
+
export function frexp(value, exponent, offset_into_exponent = 0) {
|
|
9
10
|
if (value === 0 || Number.isFinite(value) === false) {
|
|
10
|
-
exponent[
|
|
11
|
+
exponent[offset_into_exponent] = 0;
|
|
11
12
|
return value;
|
|
12
13
|
}
|
|
13
14
|
|
|
@@ -37,7 +38,7 @@ export function frexp(value, exponent) {
|
|
|
37
38
|
mantissa = -mantissa;
|
|
38
39
|
}
|
|
39
40
|
|
|
40
|
-
exponent[
|
|
41
|
+
exponent[offset_into_exponent] = exp;
|
|
41
42
|
|
|
42
43
|
return mantissa;
|
|
43
44
|
}
|