Ancestors

Toot

Written by Walter Tross on 2024-05-29 at 21:16

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

Descendants

Written by Walter Tross on 2024-05-29 at 21:21

Long gone are the times of bc -lq ;-)

=> More informations about this toot | More toots from waltertross@mastodon.online

Written by Walter Tross on 2024-05-29 at 22:46

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

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/112526453355077640
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
258.426192 milliseconds
Gemini-to-HTML Time
1.886955 milliseconds

This content has been proxied by September (ba2dc).