Skip to main content Accessibility help
×
Hostname: page-component-76fb5796d-45l2p Total loading time: 0 Render date: 2024-04-26T20:19:30.638Z Has data issue: false hasContentIssue false

8 - Numerics

Published online by Cambridge University Press:  05 February 2013

Get access

Summary

Of the many data types that are used in programming – numbers, strings, symbols, lists – numbers are perhaps the most familiar. You can work with all kinds of numbers in Mathematica, but what distinguishes it from traditional programming languages and other computational systems is that with it you can operate on numbers of any size and to any degree of precision. In this chapter we will explore some of the issues related to working with numerical quantities and show how you can incorporate these ideas into programs that involve numerical computations to gain greater control over the precision and accuracy of your results as well as to improve the efficiency of your numerical computations and programs.

Numbers in Mathematica

One of the first things you will notice as you start using Mathematica is the manner in which it treats numbers compared with other systems such as calculators, traditional programming languages, and other technical computing software. In most traditional programming languages, you must declare the type of number your functions can take as an argument. Although Mathematica automatically handles such details for you an understanding of the different number types and how they invoke different algorithms is helpful for taking full advantage of Mathematica's numerical capabilities and for writing efficient programs.

Mathematica operates differently depending upon the type of input you give it. For example, the following two inputs each compute sin(π / 3) but something quite different results.

Type
Chapter
Information
Programming with Mathematica®
An Introduction
, pp. 251 - 308
Publisher: Cambridge University Press
Print publication year: 2013

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

  • Numerics
  • Paul Wellin
  • Book: Programming with <I>Mathematica</I>®
  • Online publication: 05 February 2013
  • Chapter DOI: https://doi.org/10.1017/CBO9780511972942.009
Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

  • Numerics
  • Paul Wellin
  • Book: Programming with <I>Mathematica</I>®
  • Online publication: 05 February 2013
  • Chapter DOI: https://doi.org/10.1017/CBO9780511972942.009
Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

  • Numerics
  • Paul Wellin
  • Book: Programming with <I>Mathematica</I>®
  • Online publication: 05 February 2013
  • Chapter DOI: https://doi.org/10.1017/CBO9780511972942.009
Available formats
×