Comparing version 0.9.3 to 0.9.4
@@ -0,1 +1,4 @@ | ||
## 0.9.4 (Dec 21, 2021) | ||
* Fix uninitialized usage of mpz_t (by Yuri Stuken) | ||
## 0.9.3 (Dec 17, 2021) | ||
@@ -2,0 +5,0 @@ * Support setting radix for Float string operations (by Yuri Stuken) |
{ | ||
"name": "gmp-wasm", | ||
"version": "0.9.3", | ||
"version": "0.9.4", | ||
"description": "Arbitrary-precision Integer, Rational and Float types based on the GMP and MPFR libraries", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.umd.js", |
@@ -588,2 +588,3 @@ import type { GMPFunctions } from './functions'; | ||
} | ||
gmp.mpz_init(instance.mpz_t); | ||
const wasmBufPtr = gmp.malloc(num.length); | ||
@@ -594,5 +595,7 @@ gmp.mem.set(num, wasmBufPtr); | ||
} else if (isRational(num)) { | ||
gmp.mpz_init(instance.mpz_t); | ||
const f = ctx.floatContext.Float(num); | ||
gmp.mpfr_get_z(instance.mpz_t, f.mpfr_t, 0); | ||
} else if (isFloat(num)) { | ||
gmp.mpz_init(instance.mpz_t); | ||
gmp.mpfr_get_z(instance.mpz_t, (num as Float).mpfr_t, (num as Float).rndMode); | ||
@@ -599,0 +602,0 @@ } else { |
@@ -449,2 +449,3 @@ import { DivMode } from '../src/integer'; | ||
compare(ctx.Integer(ctx.Float('1.50')), '2'); | ||
compare(ctx.Integer(ctx.Float('1.11111111')), '1'); | ||
}); | ||
@@ -451,0 +452,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
3629602
28455