Satimage Previous | Next
Applying functions to arrays of real
Home Documentation Smile Computing Smile's maths Applying functions to arrays of real  
  • Unlike a built-in arithmetic operator of AppleScript, a command can accept various data types. All transcendental functions defined below work on numbers, on a list of real and on arrays of real.

    Smile supports the functions below. Angles are in radian.
    • cos, sin, tan, acos, asin, atan, atan2 (usage: atan2 (y, x))
    • cosh, sinh, tanh, acosh, asinh, atanh
    • ln, log10, exp
    • sqr, sqrt, hypot (usage: hypot {x, y}), abs
    • erf, erfc, gamma, lgamma

  • Using the functions above require a special caution. Indeed, the terms above really define commands with direct parameters - like when you write open the_file or print the_doc. A command has a lower precedence order than a function.

    Thus:
    sin a + sin b really computes sin (a + sin b)
    Our advice is to bracket each of the commands above between parentheses:
    (sin a) + (sin b)
Version française
Copyright ©2008 Paris, Satimage