Numerics - Wellin, Paul (Programming with Mathematica, 2013)
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 MathematicaOne 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.