Bug 16356 – cdouble is broken

Status
CLOSED
Resolution
FIXED
Severity
critical
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2016-08-06T16:00:26Z
Last change time
2018-01-26T10:45:47Z
Keywords
wrong-code
Assigned to
No Owner
Creator
Kazuki Komatsu

Comments

Comment #0 by enjouzensyou.boinc — 2016-08-06T16:00:26Z
OK: ------------------------------------ import std.stdio; /* 0+0i 1+1i 2+2i 3+3i */ void main() { cfloat c = 1f + 1fi; foreach(x; 0 .. 4) writeln(c * x); } ------------------------------------ NG: ------------------------------------ import std.stdio; /* 0+1i 1+1i 2+1i 3+1i */ void main() { cdouble c = 1 + 1i; foreach(x; 0 .. 4) writeln(c * x); } ------------------------------------ dmd: 2.071.1
Comment #1 by greensunny12 — 2016-08-06T16:43:05Z
I hardly believe that this is going to be fixed as builtin complex types are rarely used and have been scheduled for deprecation (see https://dlang.org/deprecate.html). Btw @other why is there no schedule date for complex types? Do you experience a similar behavior with std.complex? (https://dlang.org/phobos/std_complex.html)
Comment #2 by enjouzensyou.boinc — 2016-08-06T16:58:07Z
(In reply to greensunny12 from comment #1) > I hardly believe that this is going to be fixed as builtin complex types are > rarely used and have been scheduled for deprecation (see > https://dlang.org/deprecate.html). Btw @other why is there no schedule date > for complex types? > > Do you experience a similar behavior with std.complex? > (https://dlang.org/phobos/std_complex.html) I test std.complex.Complex by same code, but it has no strange behavior.
Comment #3 by greensunny12 — 2016-08-07T13:28:04Z
The deprecation of builtin complex types is WIP - see e.g. this PR for more info: https://github.com/dlang/dmd/pull/5731
Comment #4 by dlang-bugzilla — 2017-07-05T20:36:53Z
No longer reproducible after https://github.com/dlang/dmd/pull/6229. Accidentally fixed?
Comment #5 by enjouzensyou.boinc — 2018-01-26T10:45:47Z
I confirm that this issue is fixed on dmd2.078.1, and I will close this issue.