From 9ddf1d2c33aeb5d5fd2fda1fd72d40bd565a8604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Fri, 3 Aug 2018 11:36:38 +0200 Subject: [PATCH] [poincare] Increase the limit of Integer to 1E308 --- poincare/include/poincare/float.h | 11 +++++------ poincare/include/poincare/integer.h | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/poincare/include/poincare/float.h b/poincare/include/poincare/float.h index 869257a20..934fee334 100644 --- a/poincare/include/poincare/float.h +++ b/poincare/include/poincare/float.h @@ -5,12 +5,11 @@ namespace Poincare { -/* Float reprensents an approximated number. This class is use when: - * - a rational overflows - * - to avoid turning float/double into Decimal back and forth because - * performances are dramatically affected when doing so. For instance, when - * plotting a graph, we need to set a float/double value for a symbol and - * approximate an expression containing the symbol for each dot displayed). +/* Float reprensents an approximated number. This class is use to avoid turning + * float/double into Decimal back and forth because performances are + * dramatically affected when doing so. For instance, when plotting a graph, we + * need to set a float/double value for a symbol and approximate an expression + * containing the symbol for each dot displayed). * We thus use the Float class that hold a float/double. * Float can only be approximated ; Float is an INTERNAL node only. Indeed, * they are always turned back into Decimal when beautifying. Thus, the usual diff --git a/poincare/include/poincare/integer.h b/poincare/include/poincare/integer.h index bf3319991..fe7628d50 100644 --- a/poincare/include/poincare/integer.h +++ b/poincare/include/poincare/integer.h @@ -56,9 +56,9 @@ public: static IntegerReference upow(const NaturalIntegerAbstract * a, const NaturalIntegerAbstract * b); static IntegerReference ufact(const NaturalIntegerAbstract * a); - constexpr static int k_maxNumberOfDigits = 11; + constexpr static int k_maxNumberOfDigits = 32; protected: - constexpr static int k_maxNumberOfDigitsBase10 = 105; // (2^32)^k_maxNumberOfDigits-1 ~ 10^105 + constexpr static int k_maxNumberOfDigitsBase10 = 308; // (2^32)^k_maxNumberOfDigits ~ 1E308 NaturalIntegerAbstract(size_t numberOfDigits = 0) : m_numberOfDigits(numberOfDigits) {