<<新主題 | 舊主題>>
娛樂滿紛 26FUN » 電腦區 » Linux's Forgotten Gem: Calculator
返回列表 回復 發帖

Linux's Forgotten Gem: Calculator

forget about all the nice looking graphics, the quickiest programmable calculator in linux is bc. Start it with

bc -l

and you'll have a shell calculator with c-style instructions including
=,+,-,*,/,%,++,--,>,<,>=,<=,==,!=,&&,||

s(x) is sine, c(x) is cosine, a(x) is atan, l(x) is ln, e() is exp, j(n,x) is bessel function

EOF (ctrl-D) quits the program

Also, you can use it in the shell (or in a script), for example
localhost:~$ echo "(1+3)/5" | bc -l
.80000000000000000000

Finally, the -l flag is needed for floating point arithmetic, you can default this flag by putting the line
alias bc='bc -l'
in your shell start-up file

you can use "man bc" to learn more about it
ok
thx for your tips on linux....
but I don't think no one would really care about it on here....

not much people are doing programming with linux on here...
返回列表 回復 發帖
<<新主題 | 舊主題>>
娛樂滿紛 26FUN » 電腦區 » Linux's Forgotten Gem: Calculator

重要聲明:26fun.com為一個討論區服務網站。本網站是以即時上載留言的方式運作,26fun.com對所有留言的真實性、完整性及立場等,不負任何法律責任。而一切留言之言論只代表留言者個人意見,並非本網站之立場,用戶不應信賴內容,並應自行判斷內容之真實性。於有關情形下,用戶應尋求專業意見(如涉及醫療、法律或投資等問題)。 由於本討論區受到「即時上載留言」運作方式所規限,故不能完全監察所有留言,若讀者發現有留言出現問題,請聯絡我們。26fun.com有權刪除任何留言及拒絕任何人士上載留言,同時亦有不刪除留言的權利。切勿撰寫粗言穢語、誹謗、渲染色情暴力或人身攻擊的言論,敬請自律。本網站保留一切法律權利。