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:
Tomas Lindquist Olsen
2008-09-09 16:49:47 -07:00
parent 4e0b6b4bf0
commit 8e9b957bce
21 changed files with 179 additions and 229 deletions

View File

@@ -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()

View File

@@ -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;
}

View File

@@ -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
View File

@@ -0,0 +1,8 @@
module complex4;
void main()
{
cfloat c = 2f + 3fi;
float r = cast(float)c;
ifloat i = cast(ifloat)c;
}