回複:C programming problem

來源: Netlooker 2005-06-17 10:49:14 [] [舊帖] [給我悄悄話] 本文已被閱讀: 次 (616 bytes)
1. From RedHat Linux manual page

Your C-compiler can work with complex numbers if it supports the C99
standard. Link with -lm. The imaginary unit is represented by I.

/* check that exp(i*pi) == -1 */
#include /* for atan */
#include
main() {
double pi = 4*atan(1);
complex z = cexp(I*pi);
printf("%f+%f*i\n", creal(z), cimag(z));
}
I've never used it before. Just check the manual pages.

2. You need to define __USE_LARGEFILE64

Good luck.

所有跟帖: 

Thanks, where find the manual -yuricc- 給 yuricc 發送悄悄話 (62 bytes) () 06/17/2005 postreply 11:02:12

I see now -yuricc- 給 yuricc 發送悄悄話 (94 bytes) () 06/17/2005 postreply 11:13:17

請您先登陸,再發跟帖!

發現Adblock插件

如要繼續瀏覽
請支持本站 請務必在本站關閉/移除任何Adblock

關閉Adblock後 請點擊

請參考如何關閉Adblock/Adblock plus

安裝Adblock plus用戶請點擊瀏覽器圖標
選擇“Disable on www.wenxuecity.com”

安裝Adblock用戶請點擊圖標
選擇“don't run on pages on this domain”