For some limited number of special cases, fp64_compare returned the wrong result. This is fixed now.
Author: Uwe
Documentation updated
I cleaned up the library reference, inserted a table of contents and organized the reference in a slightly different way: All the conversion functions are now grouped together towards the end of the reference. Additionally, links between the documentation of the functional groups and the library reference were installed. All this shold it make easier to quickly find the functions needed.
Due to some questions regarding sin(pi), an article is available explaing the problems of floating point math: fp64_sin(float64_NUMBER_PI) is not 0.
V1.1.25 added new function fp64_etoa for engineering format
A lot of microcomputer applications display data of sensors or calculations over a bigger range, e.g. voltages from millivolts to volts or resistors from ohm to kiloohm to megaohm. Usually, data is then displayed in engineering format, which is similar to scientific notation, but the exponent is always a multiple of 3 (e.g. 12.345E3
instead of 1.2345E4
).
A new function, fp64_etoa is available for this use case. It has the exact same parameters as fp64_ftoa, making code changes easy. Application could even offer the user the possibility to switch between the scientific notation and engineering notation by using fp64_ftoa or fp64_etoa respectively.
V1.1.25 also fixed a bug in fp64_ftoa, that occured only on the MEGA 256 processors like on the Arduino Mega board.
V1.1.24 changed handling of 0 in fp64_to_decimalExp
fp64_to_decimalExp now returns the specified number of decimal digits instead of just “0”.
E.g., fp64_to_decimalExp(x,4,false,NULL)
will return “0.000E0
” instead of “0
“.
With that change, behaviour is now consistent for all finite numbers, but it will be no longer consistent with the the previous 64-bit C-library avr_f64.c.
V1.1.23 fixes bug in Double demo program
There were some small errors in the Double demo program, using the wrapper class. These were fixed with V1.1.23.
V1.1.22 More examples & Double wrapper class
Based on some posts on various arduino platforms, it seems that especially programming beginners have had some difficulties in using fp64lib. In order to ease entry into fp64lib, the Examples section of the homepage was overhauled, existing examples were updated and new examples were added, including a wrapper class called Double.
V1.1.21 fixes some bugs
Issues #16 (wrong value from fp64_log2) and #18 (wrong values from fp64_uint16_to_float64) were fixed.
Homepage updated
With V1.2.20, fp64lib already implements 80 functions and it was time to give the users a little bit more structure on what is available. Therefore, the library references was made consistent in style, a table of contents for the more complex pages were introduced and a new page lists the functions by functional groups (like basic math, trigonometric functions, …). Hope this helps especially new users.
V1.1.20 new function for better math.h coverage
The following functions were added to improve coverage required for full math.h compatibility:
fp64_ilogb, fp64_logb, fp64_exp2, fp64_asinh, fp64_acosh, fp64_atanh, fp64_scalbln, fp64_scalbn
See the library reference for details on these functions.
About
double
on the Arduino Uno is not what you think, double
on the Arduino Uno is the same as float
, giving you only 6-7 digits of precision! fp64lib was created to implement full 64-bit floating point arithmetic on the AVR MegaAVR architecure microprocessors. Data format is fully compatible with IEEE 754 binary64 standard, providing you 15-17 digits of accuracy.
The library also comes with a math.h compatible header file named “fp64-math.h”. All fp64lib routines start with “fp64_”, e.g. fp64_sin or fp64_add. Library is fully compatible to usual “math.h” routines and includes functions for basic arithmetic, checking and comparing, trigonometry, conversion, logarithms and hyperbelic math. Read more…