libdfp
libdfp copied to clipboard
sinhd64(small) is not small
This fails:
/* Prereq: dnf install libdfp-devel */ #define STDC_WANT_DEC_FP 1 #define STDC_WANT_IEC_60559_DFP_EXT 1
#include <assert.h> #include <stdio.h> #include <float.h> #include <math.h>
int main(void){
if(1){ _Decimal64 dfp12 = 1.0e-25DD; dfp12 = sinhd64(dfp12); assert( 0.DD != dfp12 ); } return 0; }
confirm issue:
_Decimal64 dfp12 = 1.0e-25DD;
printf( "dfp12 : %.17DE \n", dfp12 );
dfp12 = sinhd64(dfp12);
/// assert( 0.DD != dfp12 );
printf( "dfp12 : %.17DE \n", dfp12 );
here produces:
dfp12 : 1.00000000000000000E-25
dfp12 : 0.00000000000000000E+00
Wolfram|Alpha proposes:
1.0000000000000000000000000000000000000000000000000016666666666666667... × 10^-25