aboutsummaryrefslogtreecommitdiff
path: root/src/stdlib/nums.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdlib/nums.h')
-rw-r--r--src/stdlib/nums.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stdlib/nums.h b/src/stdlib/nums.h
index f355fb6f..3f0cccc8 100644
--- a/src/stdlib/nums.h
+++ b/src/stdlib/nums.h
@@ -100,7 +100,7 @@ MACROLIKE CONSTFUNC float Num32$from_int(Int_t i, bool truncate) {
float ret = (float)mpz_get_d(*i.big);
if (!truncate) {
mpz_t roundtrip;
- mpz_init_set_d(roundtrip, ret);
+ mpz_init_set_d(roundtrip, (double)ret);
if unlikely (mpz_cmp(*i.big, roundtrip) != 0)
fail("Could not convert integer to 32-bit floating point without losing precision: ", i);
}