main
|
Last change
on this file was ef04a5c, checked in by Stephen Siegel <siegel@…>, 44 hours ago |
|
Added some more complex and collective tests.
Some minor code cleanup as well.
|
-
Property mode
set to
100644
|
|
File size:
294 bytes
|
| Line | |
|---|
| 1 | #include <complex.h>
|
|---|
| 2 | #include <assert.h>
|
|---|
| 3 |
|
|---|
| 4 | int main(void) {
|
|---|
| 5 | double _Complex x = 3.0 + 4.0i;
|
|---|
| 6 | assert(cabs(x) == 5.0);
|
|---|
| 7 | float _Complex x_f = 3.0f + 4.0if;
|
|---|
| 8 | assert(cabsf(x_f) == 5.0f);
|
|---|
| 9 | long double _Complex x_l = 3.0L + 4.0IL;
|
|---|
| 10 | assert(cabsl(x_l) == 5.0L);
|
|---|
| 11 | assert(conj(x) == 3.0 - 4.0i);
|
|---|
| 12 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.