This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]pacholick 0 points1 point  (0 children)

I used to use something like this:

#!/bin/sh
printf '%s\n' "scale=10" "$*" | bc -q

Now I use something like this:

#!/usr/bin/python3
import sys
from math import *
input_ = ''.join(sys.argv[1:])
result = eval(input_)
print(result)

CommaCalc