Mercurial > projects > dstress
annotate compile/c/cfloat_12_B.d @ 1597:8b9d4d2f925a
Fix typos in complex tests. See D bug 614.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Tue, 09 Sep 2008 16:53:58 +0200 |
parents | daef239f37cf |
children |
rev | line source |
---|---|
1247
d75d907a68bb
[Issue 614] New: Real and imaginary properties of complex numbers not allowed as template arguments
thomask
parents:
diff
changeset
|
1 // $HeadURL$ |
d75d907a68bb
[Issue 614] New: Real and imaginary properties of complex numbers not allowed as template arguments
thomask
parents:
diff
changeset
|
2 // $Date$ |
d75d907a68bb
[Issue 614] New: Real and imaginary properties of complex numbers not allowed as template arguments
thomask
parents:
diff
changeset
|
3 // $Author$ |
d75d907a68bb
[Issue 614] New: Real and imaginary properties of complex numbers not allowed as template arguments
thomask
parents:
diff
changeset
|
4 |
d75d907a68bb
[Issue 614] New: Real and imaginary properties of complex numbers not allowed as template arguments
thomask
parents:
diff
changeset
|
5 // @author@ Sean Kelly <sean@f4.ca> |
d75d907a68bb
[Issue 614] New: Real and imaginary properties of complex numbers not allowed as template arguments
thomask
parents:
diff
changeset
|
6 // @date@ 2006-11-27 |
1320
daef239f37cf
sed'ed replacement of new:...http.d.puremagic.com/issues/ with http://d.puremagic.com/issues/show_bug.cgi?...
thomask
parents:
1247
diff
changeset
|
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=614 |
1247
d75d907a68bb
[Issue 614] New: Real and imaginary properties of complex numbers not allowed as template arguments
thomask
parents:
diff
changeset
|
8 // @desc@ [Issue 614] New: Real and imaginary properties of complex numbers not allowed as template arguments |
d75d907a68bb
[Issue 614] New: Real and imaginary properties of complex numbers not allowed as template arguments
thomask
parents:
diff
changeset
|
9 |
d75d907a68bb
[Issue 614] New: Real and imaginary properties of complex numbers not allowed as template arguments
thomask
parents:
diff
changeset
|
10 module dstress.compile.c.cfloat_12_B; |
d75d907a68bb
[Issue 614] New: Real and imaginary properties of complex numbers not allowed as template arguments
thomask
parents:
diff
changeset
|
11 |
d75d907a68bb
[Issue 614] New: Real and imaginary properties of complex numbers not allowed as template arguments
thomask
parents:
diff
changeset
|
12 const cfloat a = 1.0f + 2.0fi; |
d75d907a68bb
[Issue 614] New: Real and imaginary properties of complex numbers not allowed as template arguments
thomask
parents:
diff
changeset
|
13 |
d75d907a68bb
[Issue 614] New: Real and imaginary properties of complex numbers not allowed as template arguments
thomask
parents:
diff
changeset
|
14 template getRealPart(cfloat x){ |
d75d907a68bb
[Issue 614] New: Real and imaginary properties of complex numbers not allowed as template arguments
thomask
parents:
diff
changeset
|
15 const float getRealPart = x.re; |
d75d907a68bb
[Issue 614] New: Real and imaginary properties of complex numbers not allowed as template arguments
thomask
parents:
diff
changeset
|
16 } |
d75d907a68bb
[Issue 614] New: Real and imaginary properties of complex numbers not allowed as template arguments
thomask
parents:
diff
changeset
|
17 |
d75d907a68bb
[Issue 614] New: Real and imaginary properties of complex numbers not allowed as template arguments
thomask
parents:
diff
changeset
|
18 static assert(getRealPart!(a) == 1.0f); |
d75d907a68bb
[Issue 614] New: Real and imaginary properties of complex numbers not allowed as template arguments
thomask
parents:
diff
changeset
|
19 |
d75d907a68bb
[Issue 614] New: Real and imaginary properties of complex numbers not allowed as template arguments
thomask
parents:
diff
changeset
|
20 |
d75d907a68bb
[Issue 614] New: Real and imaginary properties of complex numbers not allowed as template arguments
thomask
parents:
diff
changeset
|
21 template getImaginaryPart(cfloat x){ |
1597
8b9d4d2f925a
Fix typos in complex tests. See D bug 614.
Christian Kamm <kamm incasoftware de>
parents:
1320
diff
changeset
|
22 const float getImaginaryPart = x.im; |
1247
d75d907a68bb
[Issue 614] New: Real and imaginary properties of complex numbers not allowed as template arguments
thomask
parents:
diff
changeset
|
23 } |
d75d907a68bb
[Issue 614] New: Real and imaginary properties of complex numbers not allowed as template arguments
thomask
parents:
diff
changeset
|
24 |
d75d907a68bb
[Issue 614] New: Real and imaginary properties of complex numbers not allowed as template arguments
thomask
parents:
diff
changeset
|
25 static assert(getImaginaryPart!(a) == 2.0f); |