For gCAS3 to provide nice cross-platform computing, a C library is needed for decimal formats. I have looked at BCD, IEEE floats, IEEE decimals, and I don't think there is much else.

Right now, I am looking at IBM's Decimal32/64/128 library with extensions elsewhere for a IEEE decimal32/64/128 library with plenty of functions. However, I am looking for something written minimally but feature-rich. Any suggestions?
I'm actually very familiar with the libgmp library.
gmplib.org

Using it to calculate numbers in the millions of digits, there's an example in the archives. But WAIT Very Happy I'm releasing a solid v2.0 soon that adds and improves functionality.

Back to point: libgmp isn't just C, there are build for many languages.
How lightweight can I make gmp? It seemed it was very interdependent and pulling out one feature (binary 64bit floats) that it would be troublesome. I tried to find stripped-down versions and came back empty-handed.

Then again, I haven't looked at all of libgmp.
You should read up on all the build options and configurations.
Getting a library for just one function can be a waste, as you'll
likely find need of other functions later in the project.

Never thought I'd be using the libgmp's weird file IO, but bringing in
a number for primality check from a text file is a new feature.

Good luck. If nothing else, write your own struct to convert between
strings and unsigned long long
Also, libgmp is deprecated by mpfr.
On a slightly related note, check this out for C++: (You may find they may work with C?):

http://stackoverflow.com/questions/12737182/useful-c-library-for-numeric-calculation/12737359#12737359
The main goal is ripping something out and getting it running on the Z80. I will poke around GSL and MPFR (mpfr uses gmp?) shortly.

<edit>

I am using SoftFloat and fdlibm. Right now, I am lacking a stand-alone dtoa function and possibly a strtod one. The dtoa.c on netlib apparently is buggy and also has configs to the excess. Any suggestions?
Got Liotsch's 2010 Grisu3 algorithm working in C++, should be easy to convert to C, even easier to convert to using SoftFloat.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement