Division.
Albert Redditt
albert_redditt at yahoo.com
Tue Feb 16 22:21:14 CET 2010
Hello!
I'm writing a bignum calculator.
http://www.freebasic.net/forum/viewtopic.php?t=14504
http://www.mediafire.com/?sharekey=a375220a75eafa7caaca48175a79d1c3b68a8b652153f881913616043b05bc7e
Its slow as hell!
but the divider() routine strips the decimals and then divides until a preset precision level is reached and the puts the decimal into the output string.
I had to include a divider_multiplier() and a divider_subtractor() that don't strip the leading 0's from the result, if the second number is a fraction.
I just got your library and am still reading up on the doc's
But it seems that every function; add,sub,mul,div can be made to be integer by stripping the decimal and then putting it back in after the operation.
You don't need separate int , float , rational routines. ( a fractional mul is the same as an integer mul you just need to calculate where to put the dec. in the output.)
I've read thru your doc's and the GMP lib, it returns a string and a remainder.
More information about the gmp-discuss
mailing list