Thanks for your updates to print, I have been using bignumbers as a substitute.
Just wondering, is your fix going to become part of the default IDE?
Also, how hard would it be to implement longer 'standard' numbers in the IDE? I am interested in int128, for example. For that matter, it would be great if double was in fact a double float...
First the fixes/ideas here are not only mine as more people cooperated to get this far.
I do not expect it to become part of the default IDE soon as imho it is not tested enough yet. Furthermore there are two main features in it: faster printing and printing SCI/ENG/SI format.
- The first has currently assembly in it, very fast but not portable to e.g. the DUE,
- The SCI/ENG/SI formatting works only for floats at the moment. Maybe 3 extra formats is too much.
- Support for printing long long; // maybe most stable part
On the positive site the lib is backwards compatible so it can be used by the ones who want to.
Finally Paul Stoffregen, Designer of the Teensy - http://www.pjrc.com/teensy/index.html
-, will incorporate the work in a coming (not perse next) release. Mentioned above somewhere.
Implementing an IEEE754(?) 64bit double in the IDE is not trivial and would take quite some time.
Implementing a proprietary larger float is simpler, one can make a class that uses for example
bool s; // sign, true => negative;
unsigned long m; // 32 bits mantisse => 9 significant digits iso 32bit float 23 bits mantissse which has 6-7 significant digits.
int exponent; // use power of 10 => -32767 .. +32767 (OK maybe a byte is enough ;)
Then you need to implement a math library and conversion from and to existing base types (at least float), not very difficult but not trivial either. quite some work.
Start with +* -/% and boolean operators like < > == and !=
If that works then continue with functions like sin() cos() exp() ln() pow() sqrt() trunc() floor() ceil() etc.
Implementing an int128 class is probably easier but it will be very slow. Have you ever worked with the LONG LONG ?