Satimage Previous | Next
Performing arithmetic on arrays of real
Home Documentation Smile Computing Smile's maths Performing arithmetic on arrays of real  
AppleScript does not support extending the standard operators (+ - * /) to custom data types.

To perform arithmetic operations on arrays of real (or on lists of numbers) you must use specific commands. The commands below provide for basic arithmetic operations. See also evalformula in another page to compute any expression.
  • addlist
  • sublist
  • multlist
  • divlist
The commands above may mix arrays of real and numbers.
set a to createarray 10000 range {0, 2*pi}
set c to (cos a)
set s to (sin a)
set cs to multlist c with s
set s2 to multlist cs with 2
-- s2 contains 2 * sin a * cos a
  • runningsum returns the running sum of an array of real.
Version française
Copyright ©2008 Paris, Satimage