t> NUMBERS AND CONSTANTS, STRINGS AND NAMES
b> 
t> Numbers, strings, and names are the simplest objects in Maple.  The
t> following sections give you a basic understanding of how to recognize
t> and use these objects.
b>
c1>
t> Integers and Rationals
b>
t> There are different ways of specifying explicit values in Maple.
t> Because Maple is a symbolic product, numbers need not always be given
t> in decimal representation (though you certainly may do so if you
t> wish). Integers are the most basic exact numbers to specify, while
t> rational numbers use the division operator to separate numerator and
t> denominator.
b>
c1>
x> 31;
x> 3/7;
x> -39/13;
t> As you can see, rationals are automatically simplified by Maple.
b>
c1>
t> Floating-point Numbers
b>
t> Decimal representations of exact values are represented as you would
t> expect, and appear as the result of many of Maple's numerical
t> procedures. As well, these numbers can be represented in base 10
t> notation or scientific notation. The following are examples of
t> floating-point numbers.
b>
x> 2.3;
x> .143*10^(-44);
x> Float(3141, -3);
c1>
t> Mathematical Constants
b>
t> While integers, rationals, and floating-point numbers can be thought of
t> as constants of a sort, Maple also supports many other popular
t> mathematical constants. The list includes:
b>
n>    Pi             3.1415926535...    
n>    exp(x)         natural log base
n>    I              square root of -1  
n>    infinity 
n>    -infinity 
n>    gamma          Euler's constant 
n>    Catalan        Catalan's constant 
n>    true,false     boolean values
b>
t> Be sure to use the proper spelling (including uppercase/lowercase
t> letters) when using these constants. Pi and pi are not equivalent!
b>
c1>
t> Mixing and Matching Different Types of Values
b>
t> As was discussed before, being able to leave values in their exact
t> representation (e.g. 1/3 not .3333...) is part of the beauty of
t> symbolic algebra. Usually, Maple allows you to retain values in their
t> exact form throughout many calculations. One situation when exact
t> values will get converted to approximations is when you mix and match
t> types in an expression. The following examples should illustrate this
t> idea. (For more information on Maple expressions, see the next chapter.)
b>
x> 1/3+2;
x> 1/3+2.0;
c1>
t> Questions
b>
c2>
q> Represent the fraction 2345 divided by 34570 in its lowest terms.
a> 2345/34570;
b>
c2>
q> By adding a decimal point to the value 6/7, get a numerical approximation
q> of that value.
a> 6/7.;
eoq>
b>
c1>
t> Strings and Names
b>
t> A string in Maple consists of any number of characters of any sort,
t> surrounded by backquote ` characters. Following are some examples of
t> Maple strings.
b>
x> `This is a Maple string`;
x> `123abc`;
x> `invert.src`;
c1>
t> As you can see, special characters (+, ., /, etc.) may be included
t> anywhere in a string, so long as the backquote characters are present.
t> If the backquote characters are *not* present, then these special
t> characters are treated as their normal Maple operations.
b>
x> 3+abc+4;
x> directory/filename;
x> invert.src;
c1>
t> A name in Maple is a special type of string, which in its simplest
t> form is a letter (a-z, A-Z) followed by zero or more letters,
t> digits (0-9), and underscores (_). Names are case-sensitive, that is, 
t> MyName is distinct in Maple from myname.
b>
t> One difference between names and strings is that names do not need to
t> be enclosed with backquotes - unless the name contains special
t> characters that the user does not wish to be evaluated.
b>
c1>
t> The following are some examples of valid Maple names.
b>
x> MyVariable;
x> hello;
x> `greatest common divisor`;
c1>
t> While these are examples of invalid Maple names.
b>
t>    +thequotient;
b>
t>    ...etc;
b>
t>    `no backquotes 'round me!;
b>
c1>
t> Concatenation Operator
b>
t> A handy tool in the construction of Maple strings and names is the
t> concatenation operator. Use the period character for concatenation, but
t> take care to keep clear the difference between a period as a decimal
t> point and a period as a concatenation operator. The rule to remember is
t> that a concatenation operator must have a name as its left-hand element.
t> Some examples of concatenation follow.
b>
x> vname.2;
x> Fred.` is a friend of mine`;
c1>
t> Questions
b>
c2>
q> Enter your full name as a Maple name.
a> `Jane Smith`;
c2>
q> Use the period as a concatenation operator to create a name that consists of 
q> the phrase "just about " and the value 3.
a> `just about `.3;
eoq>
eof>


