diff options
author | Mike Buland <mike@xagasoft.com> | 2014-09-17 08:50:36 -0600 |
---|---|---|
committer | Mike Buland <mike@xagasoft.com> | 2014-09-17 08:50:36 -0600 |
commit | 3ada65d36621787f8dd103e9ae19083ef3c1df5b (patch) | |
tree | 75dbdbe115bfa83923ccbf50bddf6d3e5574a2cd /src | |
parent | abe7e449143052b07fae688da690c2a7d387a291 (diff) | |
download | clic-3ada65d36621787f8dd103e9ae19083ef3c1df5b.tar.gz clic-3ada65d36621787f8dd103e9ae19083ef3c1df5b.tar.bz2 clic-3ada65d36621787f8dd103e9ae19083ef3c1df5b.tar.xz clic-3ada65d36621787f8dd103e9ae19083ef3c1df5b.zip |
Issues with small decimal numbers were in toString.
It was bailing on very small numbers with only one decimal point of
precision, which is silly. This has been fixed.
Diffstat (limited to 'src')
-rw-r--r-- | src/number.cpp | 2 | ||||
-rw-r--r-- | src/parser.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/number.cpp b/src/number.cpp index 1b0efdc..0b8e07b 100644 --- a/src/number.cpp +++ b/src/number.cpp | |||
@@ -541,7 +541,7 @@ Bu::String Number::toString() const | |||
541 | { | 541 | { |
542 | int iSigDig = iScale-1; | 542 | int iSigDig = iScale-1; |
543 | for( ; iSigDig >= 0 && aFrac.get( iSigDig ) == 0; iSigDig-- ) { } | 543 | for( ; iSigDig >= 0 && aFrac.get( iSigDig ) == 0; iSigDig-- ) { } |
544 | if( aInt.getSize() == 0 && iSigDig <= 0 ) | 544 | if( aInt.getSize() == 0 && iSigDig < 0 ) |
545 | return "0"; | 545 | return "0"; |
546 | Bu::String sRet; | 546 | Bu::String sRet; |
547 | if( !bPositive ) | 547 | if( !bPositive ) |
diff --git a/src/parser.cpp b/src/parser.cpp index cf3bb3f..607de8a 100644 --- a/src/parser.cpp +++ b/src/parser.cpp | |||
@@ -5,7 +5,7 @@ | |||
5 | #include <bu/sio.h> | 5 | #include <bu/sio.h> |
6 | #include <stdlib.h> | 6 | #include <stdlib.h> |
7 | 7 | ||
8 | #define DEBUG | 8 | //#define DEBUG |
9 | 9 | ||
10 | Parser::Parser( Lexer &lex, Bu::Stream &rOut ) : | 10 | Parser::Parser( Lexer &lex, Bu::Stream &rOut ) : |
11 | lex( lex ), | 11 | lex( lex ), |