home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / calculat / sm30a.zip / IF.KEY < prev    next >
Text File  |  1993-11-07  |  608b  |  16 lines

  1. * if                                                  internal
  2. if(condition then x)
  3. It gives x if condition evaluates to 1, or left unevaluated otherwise.
  4.  
  5. if(condition then x else y)     
  6. It gives x if condition evaluates to 1, y if it evaluates to 0, or 
  7. left unevaluated if the condition is neither 1 nor 0.
  8. Note that the words then and else can be replaced by comma ,.
  9. It is useful in definition of the use-defined function to left the
  10. function unevaluted if the argument of the function is not number.
  11. See also: isnumber.
  12. e.g.
  13. IN:  f(x_):=if(isnumber(x), 1)
  14. IN:  f(x), f(10)
  15. OUT: f(x), 1
  16.