Bug 46

Summary: Constant folding with long doubles
Product: C/C++ compiler Reporter: Walter Bright <bugzilla>
Component: scppnAssignee: Walter Bright <bugzilla>
Status: RESOLVED FIXED
Severity: normal
Priority: P3
Version: unspecified
Hardware: PC
OS: Windows

Description Walter Bright 2009年12月11日 14:47:34 UTC
Reported by Fred J. Tydeman
/* Fails */
#include <stdio.h>
#define LDBL long double
#define MIN_LDBL (0x1p-16382L)
#define DEN_LDBL (0x1p-16445L)
int main(void){
 LDBL ld1, ld2, ld3, ld4;
 ld1 = MIN_LDBL - DEN_LDBL;
 ld2 = MIN_LDBL;
 ld3 = DEN_LDBL;
 ld4 = ld2 - ld3;
 if( 0.L == ld1 ){
 (void)printf("Fail\n");
 }
 (void)printf("ld1=%Lg\n", ld1);
 (void)printf("ld2=%Lg\n", ld2);
 (void)printf("ld3=%Lg\n", ld3);
 (void)printf("ld4=%Lg\n", ld4);
 return 0;
}
Comment 1 Walter Bright 2010年05月16日 21:46:30 UTC
Fixed version 8.52

AltStyle によって変換されたページ (->オリジナル) /