Re: Order of operations (was: Eigenvalues &/or eigenvectors)
Re: Order of operations (was: Eigenvalues &/or eigenvectors)
- Subject: Re: Order of operations (was: Eigenvalues &/or eigenvectors)
- From: roy whelden <email@hidden>
- Date: Fri, 9 May 2003 09:00:01 -0700
I suspect that the arithmetical abilities of AppleScript have been
unfairly maligned in some recent listings. I'll admit I've had scant
experience with other programming languages, but AppleScript has
offered me some useful arithmetical programs. Just two little
excamples:
(1) A script which can elegantly discover factors of any integer
(within the limits set by the language). For example, it can discover
the factors 2601 and 3379721 of the integer 987654321 in a very short
time, using a pretty cool algorithm.
(2) A script which leverages the power of the Unix utility bc (standing
for basic calculator, I guess) via handlers like:
on sin(x)
set y to do shell script "echo 'scale=n; s(" & x & ") ' | bc -l"
return y
end sin
which returns, really quickly, the sine of x to n places. (See the man
page for bc.)
At the least, such scripts have been adequate to my modest arithmetical
needs.
Roy
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.