Skip to main content

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: multiclause 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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 54.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 1996 Springer-Verlag New York, Inc.

About this chapter

Cite this chapter

Gaylord, R.J., Kamin, S.N., Wellin, P.R. (1996). Conditional Function Definitions. In: An Introduction to Programming with Mathematica®. Springer, New York, NY. https://doi.org/10.1007/978-1-4612-2322-1_6

Download citation

  • DOI: https://doi.org/10.1007/978-1-4612-2322-1_6

  • Publisher Name: Springer, New York, NY

  • Print ISBN: 978-1-4612-7502-2

  • Online ISBN: 978-1-4612-2322-1

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics