wcalc, bc

wcalc

科学技術計算機。piやeを始めとする多数の定数を使える。単位の変換にも使える。

[主なコマンド]

\pXXX Precision

-b, \b binary output

-h, \h hexadecimal output

-o, \o octal output

-r, \r Toggles radians/degrees

\e Rotates scientific notations

-E, -EE Scientific notations or NOT

\delim Shows delimiters

\prefs Prints settings

\li Lists variables

\save filename.txt Saves the current session and variables

\convert unit1 unit2 converts from unit1 to unit2

\? Help


bc

C言語に似たプログラミング可能な任意精度の計算機。

vimで各行の計算

1/3

a(1)*4

:'<,'>!bc -l


*丸め誤差について

wcalcとbcでは丸め誤差の扱いが異なるので注意が必要。

$ echo '1/3*3'|bc

.99999999999999999999

$ echo '1/3*3'|wcalc

 = 1