mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-18 01:39:03 +02:00
Complex number should now follow the D ABI on x86. They're also treated as first class values now. Big change.
This commit is contained in:
@@ -7,12 +7,8 @@ void main()
|
||||
cfloat cf3 = func();
|
||||
auto c1 = cf1 + cf2;
|
||||
auto c2 = cf2 - cf3;
|
||||
{
|
||||
auto c3 = cf1 * cf3;
|
||||
{
|
||||
auto c4 = cf2 / cf3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cfloat func()
|
||||
|
||||
@@ -4,11 +4,7 @@ void main()
|
||||
{
|
||||
cdouble c = 3.0 + 0i;
|
||||
cdouble d = 2.0 + 0i;
|
||||
{
|
||||
cdouble c1 = c + 3.0;
|
||||
cdouble c2 = c - 3.0i;
|
||||
}
|
||||
{
|
||||
cdouble c1 = c / 2.0;
|
||||
}
|
||||
cdouble c1 = c + 3.0;
|
||||
cdouble c2 = c - 3.0i;
|
||||
cdouble c3 = c / 2.0;
|
||||
}
|
||||
|
||||
@@ -5,5 +5,5 @@ void main()
|
||||
cfloat c1 = 1f + 0i;
|
||||
cfloat c2 = 0f + 0i;
|
||||
c2 += 1f + 0i;
|
||||
//assert(c1 == c2);
|
||||
assert(c1 == c2);
|
||||
}
|
||||
|
||||
8
tests/mini/complex4.d
Normal file
8
tests/mini/complex4.d
Normal file
@@ -0,0 +1,8 @@
|
||||
module complex4;
|
||||
|
||||
void main()
|
||||
{
|
||||
cfloat c = 2f + 3fi;
|
||||
float r = cast(float)c;
|
||||
ifloat i = cast(ifloat)c;
|
||||
}
|
||||
Reference in New Issue
Block a user