4 ms·
> Notice that there are even machine language instructions for cos, atan, tan, sin, ln, etc. How do you call those instructions in bash? How do you call those
by saagarjha 8y ago
> Notice that there are even machine language instructions for cos, atan, tan, sin, ln, etc. How do you call those instructions in bash?
How do you call those in Python ;)
Fundamentally, you're making a big deal about something that isn't really that horrible. Not everyone has Python on their system, and a fork() is not a terribly costly operation for a shell script. Sure, it might take an extra microwatt, but arguing that this is the same as Bitcoin mining or rolling coal is an argument in the extreme.
- DonHopkins 8y ago>>> import math >>> help(math.sin) Help on built-in function sin in module math: sin(...) sin(x) Return the sine of x (measured in radians). >>> print math.sin(math.pi) 1.22464679915e-16 Name somebody in the real world who doesn't work full time for the Computer Museum, who doesn't already have Python on their system, and can't easily install it? That's a straw man argument and in no way justifies using bash in 2019. If you were able to easily add 1.5 and 0.5 in APPLESOFT on your Apple ][+ by typing "PRINT 1.5 + 0.5" 40 years ago, and you could even add 1 and 1 by typing "PRINT 1 + 1" without decorating it with a bunch of ridiculous punctuation ((double parens, really?)) in INTEGER BASIC on your APPLE ][, you would see bash's lack of that ability as pretty extreme. Sheez, even APPLESOFT had SIN and COS and SQR. But not bash. https://www.calormen.com/jsbasic/reference.html https://www.calormen.com/jsbasic/reference.html
- saagarjha 8y ago> Name somebody in the real world who doesn't work full time for the Computer Museum, who doesn't already have Python on their system, and can't easily install it? That's a straw man argument and in no way justifies using bash in 2019. Me: I SSH into systems that I don't have permission to install new things on. > without decorating it with a bunch of ridiculous punctuation ((double parens, really?)) This is a nitpick, and you're missing the point: bash isn't the best tool to do numerical computation because it can call out to other programs with very little syntactical overhead. The fact that it has the ability to do basic arithmetic is something I brought up to be snarky: this feature is rarely used in practice.
- DonHopkins 8y ago>Me: I SSH into systems that I don't have permission to install new things on. Then you probably also don't have permission to demand that people not use spaces in their file names.