libdfp icon indicating copy to clipboard operation
libdfp copied to clipboard

acoshd64(large) is infinity

Open tydeman opened this issue 1 year ago • 1 comments

The following code fails:

/* Prereq: dnf install libdfp-devel */ #define STDC_WANT_DEC_FP 1 #define STDC_WANT_IEC_60559_DFP_EXT 1

#include <assert.h> #include <math.h>

int main(void){ if(1){ _Decimal64 dfp5 = 9.9999999999999990e+384DD; dfp5 = acoshd64(dfp5); assert( !isinf(dfp5) ); } return 0; }

tydeman avatar Aug 02 '25 02:08 tydeman

confirm issue,

        _Decimal64 dfp5 = 9.9999999999999990e+384DD; 
        printf( "dfp5 : %.17DE \n", dfp5 ); 
        dfp5 = acoshd64(dfp5); 
///         assert( !isinf(dfp5) ); 
        printf( "dfp5 : %.17DE \n", dfp5 ); 

here produces:

dfp5 : 9.99999999999999900E+384
dfp5 : INF

should rather be something near 887.18840798326753355 .

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