https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103030
Bug ID: 103030 Summary: floating point to int inconsistency Product: gcc Version: 9.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: c25devbiz at aol dot com Target Milestone: --- #include <math.h> typedef long long llong; int main(int argc,char **argv){; int ex=0; llong num_z=0xf70694892bddbb3f,num_x=0x0000000000f88640;double *z_p=(void *)&num_z,*x_p=(void *)&num_x; static int le_v=1;char *le=(void *)&le_v;if(le[0]) { llong num_z2=0,num_x2=0;int n=0;while(n<sizeof(llong)) { num_z2<<=8;num_z2|=num_z&0xFF;num_z>>=8; num_x2<<=8;num_x2|=num_x&0xFF;num_x>>=8;n+=1; } num_z=num_z2;num_x=num_x2; }double c_f=z_p[0]*x_p[0];int a=floor(z_p[0]*x_p[0]),b=z_p[0]*x_p[0],c=c_f;if(a!=b)dprintf(2,"%d %d %d\n",a,b,c); if(1)dprintf(2,"%.15lf %.15lf %.15lf\n",z_p[0],x_p[0],c_f); return ex;}; /*fn=;gcc $fn.c -o $fn -lm -include stdio.h&&$fn*/