Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'AppleScript shell is another possibility' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
AppleScript shell is another possibility
Authored by: hayne on Jul 10, '07 12:11:52AM
Another possibility for a command-line calculator is to use my "AppleScript shell"

This provides basic calculator functionality since that is built into AppleScript. Installing Satimage's scripting addition provides all the usual trignometric functions (and much more). And you can use AppleScript syntax to define custom functionality if you desire.

Sample usage:


% ash
Welcome to ash (AppleScript Shell) version 0.62
Type: -help for help, type: -exit to exit
Sourcing "/Users/fred/.ashrc"

ash> 35 / 14.7
35 / 14.7
2.380952380952

ash> 4 + 3 * 5
4 + 3 * 5
19

ash> sin(pi/4)
sin(pi/4)
0.707106781187

ash> set x to 35 / 14.7
set x to 35 / 14.7
2.380952380952

ash> x
x
2.380952380952

ash> x * atan(1)
x * atan(1)
1.869995627136                                           


[ Reply to This | # ]