diff options
author | raveit65 <[email protected]> | 2019-04-29 16:58:56 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-04-29 16:58:56 +0200 |
commit | da5c157d1458ad5361e91ffe684d2aeb154bd3b4 (patch) | |
tree | 2896553c0a22b5bbd18ff5f39e9582a23075d887 /src | |
parent | 1957af0ef634a426c45d777a7a1000c726c3ff71 (diff) | |
download | mate-calc-da5c157d1458ad5361e91ffe684d2aeb154bd3b4.tar.bz2 mate-calc-da5c157d1458ad5361e91ffe684d2aeb154bd3b4.tar.xz |
Revert "fixes issues 25 and 26"
This reverts commit de580bfc5d8dfa5f734d8d152c9940a110ee65a8.
Diffstat (limited to 'src')
-rw-r--r-- | src/mp-serializer.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/mp-serializer.c b/src/mp-serializer.c index 2a5c3e3..560aa64 100644 --- a/src/mp-serializer.c +++ b/src/mp-serializer.c @@ -352,19 +352,14 @@ mp_cast_to_exponential_string(MpSerializer *serializer, const MPNumber *x, gbool gchar * mp_serializer_to_string(MpSerializer *serializer, const MPNumber *x) { - MPNumber cmp, xcmp; gchar *s0; int n_digits = 0; - mp_set_from_integer(10, &cmp); - mp_xpowy_integer(&cmp, -(serializer->priv->trailing_digits), &cmp); - mp_real_component(x, &xcmp); - mp_abs(&xcmp, &xcmp); + switch(serializer->priv->format) { default: case MP_DISPLAY_FORMAT_AUTOMATIC: s0 = mp_cast_to_string(serializer, x, &n_digits); - if ((n_digits <= serializer->priv->leading_digits && - mp_is_greater_equal(&xcmp, &cmp)) || mp_is_complex(x)) + if (n_digits <= serializer->priv->leading_digits) return s0; else { g_free (s0); |