libdfp icon indicating copy to clipboard operation
libdfp copied to clipboard

hypotd64(0.DD, small) is zero

Open tydeman opened this issue 1 year ago • 1 comments

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; }

tydeman avatar Aug 04 '25 23:08 tydeman

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

newbie-02 avatar Aug 10 '25 17:08 newbie-02