11.07.2015 Views

Advanced Programming Guide

Advanced Programming Guide

Advanced Programming Guide

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5.3 Floating-Point Models in Maple • 205arrays of floating-point values. For details and examples, see the ?Array,?Matrix, and ?Vector help pages.5.3 Floating-Point Models in MapleMaple can represent symbolic constants, such as π and γ, exact integersand rational numbers, such as 37 and 3/4, and approximations to numericvalues, using its floating-point system. Numbers in this systemare represented by pairs of integers, (m,e). The first integer is called thesignificand or mantissa. The second integer is called the exponent.The number represented ism × 10 e .Examples of floating-point numbers in Maple are 3.1415, 1.0, −0.0007,1.0e0, and 2e1234567. The last two are examples of floating-point numbersentered in scientific notation: the "e" separates the mantissa and exponentof the number. Such numbers can also be used to represent complexnumbers (as can exact integers and rationals), for example, 1.0 + 2.7 ∗ I.In some contexts, Maple distinguishes between software floats andhardware floats. The evalhf evaluator (discussed in section 5.2), for example,works with hardware floats, and Maple can construct certain kindsof matrices and vectors with hardware float entries. Generally, however,Maple works with software floats to perform approximate (but usuallyvery accurate) numerical calculations.Floating-point number systems are approximations to the mathematicalset of real (and complex) numbers, and hence necessarily havelimitations. Most importantly, such systems have limited range (there arelargest and smallest representable numbers) and limited precision (theset of representable floating-point numbers is finite). One very importantfeature of the Maple software floating-point system is that you controlthe precision: you can specify the precision Maple uses for floating-pointcomputations.Some of the specific details of these computation systems are providedin the next few sections.Software FloatsMaple software floating-point computations are performed in base 10.The precision of a computation is determined by the setting of Digits.The maximum exponent, minimum exponent, and maximum value for

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!