- 论坛徽章:
- 0
|
原帖由 MMMIX 于 2008-8-1 20:17 发表
一般来说,gcc 编译不出错,语法都不会有问题。这点信心还是要有的。
1i 这个是 gcc 的扩展,表示复数。编译时用 -pedantic -std=c99 会有警告的。
呵呵,找到了。
To write a constant with a complex data type, use the suffix `i' or
`j' (either one; they are equivalent). For example, `2.5fi' has type
`_Complex float' and `3i' has type `_Complex int'. Such a constant
always has a pure imaginary value, but you can form any complex value
you like by adding one to a real constant. This is a GNU extension; if
you have an ISO C99 conforming C library (such as GNU libc), and want
to construct complex constants of floating type, you should include
`<complex.h>' and use the macros `I' or `_Complex_I' instead.
我原来想得偏门了。联想到了一个编译器实现相关的东西了。 |
|