Advertisement

Conditional Function Definitions

  • Richard J. Gaylord
  • Samuel N. Kamin
  • Paul R. Wellin

Abstract

An essential aspect of computer programs is their ability to make decisions — to proceed differently depending upon properties of the data they are operating upon. In this chapter, we explore two different ways of building decision-making into Mathematica programs: multi-clause definitions, in which a function is defined by more than one rule; and conditional functions, which return one of several values depending upon a condition. These features will greatly expand what we can do with Mathematica; they are also a crucial step toward learning the basic techniques of recursion and iteration.

Keywords

Function Definition Point Quadrant Conditional Expression Empty List Conditional Function 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer Science+Business Media New York 1993

Authors and Affiliations

  • Richard J. Gaylord
    • 1
  • Samuel N. Kamin
    • 2
  • Paul R. Wellin
    • 3
  1. 1.Dept. of Materials ScienceUniversity of IllinoisUrbanaUSA
  2. 2.Dept. of Computer ScienceUniversity of IllinoisUrbanaUSA
  3. 3.Dept. of MathematicsCalifornia State UniversityRohnert ParkUSA

Personalised recommendations