libdfp
libdfp copied to clipboard
hypotd64(0.DD, small) is zero
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 dfp15 = 1.0000000000000000e-383DD; dfp15 = hypotd64(0e0DD,dfp15); assert( 0.DD != dfp15 ); } return 0; }
confirm issue,
_Decimal64 dfp15 = 1.0000000000000000e-383DD;
printf( "dfp15 : %.17DE \n", dfp15 );
dfp15 = hypotd64(0e0DD,dfp15);
/// assert( 0.DD != dfp15 );
printf( "dfp15 : %.17DE \n", dfp15 );
here produces:
dfp15 : 1.00000000000000000E-383
dfp15 : 0.00000000000000000E+00
gnumeric proposes:
1E-383