libdfp icon indicating copy to clipboard operation
libdfp copied to clipboard

sinhd64(small) is not small

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 dfp12 = 1.0e-25DD; dfp12 = sinhd64(dfp12); assert( 0.DD != dfp12 ); } return 0; }

tydeman avatar Aug 04 '25 08:08 tydeman

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

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