3 ms·
Probably known to most, but your shell can also do simple arithmetic by itself. $ echo $((3**5)) 243
by cespare 13y ago
Probably known to most, but your shell can also do simple arithmetic by itself.
$ echo $((3**5))
243
- kps 13y agoksh and zsh support floating point, and ksh also has the usual math functions. $ echo $((2 * atan2(1, 0))) 3.14159265358979324
- dgl 13y agoIn zsh you could use noglob to make this nicer: zmodload zsh/mathfunc _calc() { echo $[$*] } alias c='noglob _calc' Then: % c 2 * atan(1, 0) 3.1415926535897931 (Although this works with any command, using an alias with qalc as pointed out above might be more useful.)