2.0
acw/focus-triggers
main
|
Last change
on this file since 2b25839 was a78dd2e, checked in by Stephen Siegel <siegel@…>, 11 days ago |
|
Further work on complex numbers; now $input works for complexes.
Introducing a "bugs" directory for examples that reveal bugs in CIVL.
|
-
Property mode
set to
100644
|
|
File size:
292 bytes
|
| Rev | Line | |
|---|
| [478ca9e] | 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);
|
|---|
| [a78dd2e] | 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);
|
|---|
| [478ca9e] | 12 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.