gavinhoward / bc

An implementation of the POSIX bc calculator with GNU extensions and dc, moved away from GitHub. Finished, but well-maintained.
https://git.gavinhoward.com/gavin/bc
Other
162 stars 32 forks source link

Implementation of an alternate algorithm for reciprocal values #17

Closed stesser closed 5 years ago

stesser commented 5 years ago

I'm still not sure about correct scale values and situations in which bc_num_extend must be called to prepare a BcNum that is to receive the result of an arithmetic operation. This leads to overflow for large values (the algorithm is essentially correct, but variables need to be extended in some cases).

gavinhoward commented 5 years ago

How does this new algorithm compare to Newton-Raphson performance-wise?

gavinhoward commented 5 years ago

Also, would it be possible for you to fix the crashes on both algorithms? The test suite crashes on both. It would also be nice if you could put them in a #if 0 #else #endif set so I can test the changes and see which one is faster. Thank you.

gavinhoward commented 5 years ago

Closed by manually merging.