-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
diff --git a/libbf.c b/libbf.c | ||
--- a/libbf.c | ||
+++ b/libbf.c | ||
@@ -3103,9 +3103,15 @@ static int bf_atof_internal(bf_t *r, slimb_t *pexponent, | ||
expn = -expn; | ||
} | ||
if (is_dec) { | ||
+#ifdef USE_BF_DEC | ||
a->expn = expn + int_len; | ||
a->sign = is_neg; | ||
ret = bfdec_normalize_and_round((bfdec_t *)a, prec, flags); | ||
+#else | ||
+ // bfdec_normalize_and_round not available without USE_BF_DEC | ||
+ bf_set_nan(r); | ||
+ ret = BF_ST_MEM_ERROR; | ||
+#endif | ||
} else if (radix_bits) { | ||
/* XXX: may overflow */ | ||
if (!is_bin_exp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters