[問題] 三角函數問題
開發平台(Platform): window & arduino
額外使用到的函數庫(Library Used): math.h
問題(Question):
我本來是用arduino在做三角函數的運算
發現了這個問題
轉到DEV C++上一樣有這個情況
因為這差距實在很大
我覺得應該是我什麼地方沒注意到
但又不知道該從何開始
所以上來問問大家
給我個意見吧
餵入的資料(Input):cos(-180)
預期的正確結果(Expected Output):-1
錯誤結果(Wrong Output):-0.59846
程式碼(Code):
#include <iostream>
#include <math.h>
using namespace std;
int main(){
double i = cos(-180);
cout<<i<<endl;
return 0;
}
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 125.231.33.33
※ 編輯: kuso0516 來自: 125.231.33.33 (09/09 21:13)
推
09/09 21:16, , 1F
09/09 21:16, 1F
→
09/09 21:21, , 2F
09/09 21:21, 2F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章