summaryrefslogtreecommitdiff
path: root/src/number.cpp (follow)
AgeCommit message (Collapse)Author
2015-01-29Fixed nasty subtraction bug when dealing with fractions.0.13Mike Buland
It turned out to be a really simple solution, but man, that was embarassing. I forgot to include the fractional portion of a number when fixing my radix+1 compliment numbers.
2015-01-07Fixed parsing bug, added unit tests, debug cleanup.0.12Mike Buland
There was an issue with order of operations outside of parenthesies, easily solved.
2014-11-28Division fixes, better config, more tests.0.11Mike Buland
Other minor fixes and options such as --version being added.
2014-11-24Fixed an annoying parsing bug.0.10Mike Buland
2014-11-03Made x/0 return 0 for now.Mike Buland
I have to decide how to handle special values like that, but for now it's better that it doesn't go into an infinite loop.
2014-10-31Corrected issue with particular sequences of zeros.Mike Buland
No more known division issues.
2014-10-30Maybe better? conversions aren't always good.Mike Buland
I'm not sure what part is broken yet though.
2014-10-30Used the new cuter sign logic in multiply.Mike Buland
2014-10-30Better comments!Mike Buland
2014-10-30Fixed remaining known division issues.Mike Buland
It looks great, and works with everything I can think of so far.
2014-10-30Divisors between 0 and 1 break division now.Mike Buland
2014-10-30The new division works great!Mike Buland
Other minor bug fixes including scale issues, digit() access stopped a digit before the final possible digit in the scale, >, >=, <, <= all work correctly with mixed scale numbers now, probably other fixes.
2014-09-17Issues with small decimal numbers were in toString.Mike Buland
It was bailing on very small numbers with only one decimal point of precision, which is silly. This has been fixed.
2013-05-10Added more helpers to Number.0.07Mike Buland
2013-05-10Added more checking & unit-tests.Mike Buland
2013-05-09Added Number::toRadix & Number::set( int32_t ).Mike Buland
Both very handy. I'll add other numeric setters later, it was very easy.
2013-05-09Added better filtering in Number::set, and cli options.Mike Buland
The command line options let you set the initial radix/scale, and there's a function te test if any number is prime, that's fun.
2013-04-23Added == operator to compare Numbers & stringsMike Buland
We may be able to go even a step further, but it actually parses the string as a number with the same radix and scale as the left hand side of the equation and then compares them as Numbers. This means that it's actually more resiliant to minor formatting differences.
2013-04-22Fixed bug in multiply, added toInt32 function.Mike Buland
Multiply was ignoring the zero column, which was odd. I fixed this other places but apparently missed multiply.
2013-04-21FIxed fractional support in comparisons.Mike Buland
They still don't handle mixed scale comparisons correctly, it shouldn't be too hard to add, but yeah...not supported yet.
2013-04-19Added routines to get/set scale.Mike Buland
2013-04-19Corrected bugs in division scaling and string parsing.Mike Buland
2013-04-19Fractional divisoin works.Mike Buland
It doesn't round yet, and there's a chance I should be increasing the precision, right now it keeps the precision of the left hand side number.
2013-04-19It does fractional division, but the result is an int.Mike Buland
It's funny, I haven't extended division past the ones place yet, but it does work correctly, so in theory it won't be too hard to do. I may need a little bit of extra code in the PackedIntArray class to insert a new digit at the begining.
2013-04-17Division, attempt one - broken.Mike Buland
It doesn't work by any means, and I think I confused myself partway through. I shouldn't code when I'm that tired, at least not on something this complex.
2013-04-17Now you can multiply fractional numbers.Mike Buland
2013-04-17You can now add and subtract fractional numbers.Mike Buland
2013-04-17Fractional portions parse now.Mike Buland
2013-04-17Well, the fractional portion is...making...progress...Mike Buland
2013-04-16Broke the string parser.Mike Buland
2013-04-16Cleaned up some naming.0.01Mike Buland
iOrd is now iScale (places to the right of the decimal. And iOrder is now iIdx, since it was just an index.
2013-04-16Added formatter for Number.Mike Buland
I'm a little embarassed that I didn't do this from the start, made the code so much easier to read.
2013-04-16Full support for arbitrary radixes is in place.Mike Buland
It computes the radix and bitwidth dynamically, we could probably speed that up another step by simply having a table of common ones, but for now it'll work for anything.
2013-04-16Added /, %, and = operators.Mike Buland
Division now works just fine, but by long division. There are apparently much faster ways of doing division, but as long as it works I feel like that's a great start :)
2013-04-16Added operators: -, ==, !=, <, >, <=, >=Mike Buland
Still working on division, needed some other operators to make it work.
2013-04-15Addition, subtraction, and multiplication work nowMike Buland
Division isn't working yet, there are too many options, I'll figure out something eventually :-P
2013-04-15Initial checkin.Mike Buland
This project will most likely just be stuck into libbu++, but I didn't want to deal with building it all in windows.