[Issue 24185] New: Constant folding differs between Windows and linux builds
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Oct 13 16:14:02 UTC 2023
https://issues.dlang.org/show_bug.cgi?id=24185
Issue ID: 24185
Summary: Constant folding differs between Windows and linux
builds
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: timon.gehr at gmx.ch
DMD 2.105.2:
---
void main(){
import std.stdio;
assert(42*6==252);
assert(cast(int)(4.2*60)==251); // passes on linux, fails on windows
double x=4.2;
assert(cast(int)(x*60)==252); // passes on both
}
---
Constant folding/CTFE of floating-point code differs between compile time and
runtime, and it differs even between platforms.
--
More information about the Digitalmars-d-bugs
mailing list