Since I'm rather satisfied with this alias for a CLI calculator, I'll repost it:
alias pm='python3 -qic"from math import *; import sys; sys.ps1="] "; sys.ps2="… ""'
pm stands for "Python math"
N.B.: … is a single character (ellipsis)
=> More informations about this toot | More toots from waltertross@mastodon.online
Long gone are the times of bc -lq ;-)
=> More informations about this toot | More toots from waltertross@mastodon.online
pm imports math ⇒ you have all functions and constants of https://docs.python.org/3/library/math.html available without the math. prefix, including e and pi.
And don't forget the _ variable, that holds the latest result (e.g., the inverse of what you just calculated is simply 1/_)
=> More informations about this toot | More toots from waltertross@mastodon.online This content has been proxied by September (ba2dc).Proxy Information
text/gemini