• Main Page
  • Files
  • File List
  • File Members

/Users/garethloy/Musimathics/Musimat1.2/MusimatTutorial/B0103.cpp

Go to the documentation of this file.
00001 #include "MusimatTutorial.h"
00002 MusimatTutorialSection(B0103) {
00003         Print("*** B.1.3 Data Types ***");
00004         /*****************************************************************************
00005          
00006          B.1.3 Data Types
00007          
00008          To begin, we need only two types of numbers, Integer, which is a positive or negative whole 
00009          number, and Real, which is an approximate real number. To keep things simple, let's assume for 
00010          our purposes that we have virtually unlimited precision for computations. As we go along, I intro-
00011          duce additional data types as needed.
00012          
00013          *****************************************************************************/
00014         
00015         Integer x;              // This statement introduces a variable "x" which can store an integer.
00016         x = 3;                  // This statement assigns the value 3 to integer "x".
00017         Integer y = 7;  // We can combine steps: we define y as an Integer and assign it the value 7.
00018         
00019         Real pi = 3.14; // Real variables can store real numbers
00020         Real pi2 = 22.0/7.0; // We can initialize variables with expressions.
00021         
00022         // Now let's print out the values we just created
00023         Print("x=", x);
00024         Print("y=", y);
00025         Print("pi=", pi);
00026         Print("pi2=", pi2);
00027 }
00028 
00030 /* $Revision: 1.2 $ $Date: 2006/09/05 06:32:24 $ $Author: dgl $ $Name:  $ $Id: B0103.cpp,v 1.2 2006/09/05 06:32:24 dgl Exp $ */
00031 // The Musimat Tutorial © 2006 Gareth Loy
00032 // Derived from Chapter 9 and Appendix B of "Musimathics Vol. 1" © 2006 Gareth Loy 
00033 // and published exclusively by The MIT Press.
00034 // This program is released WITHOUT ANY WARRANTY; without even the implied 
00035 // warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
00036 // For information on usage and redistribution, and for a DISCLAIMER OF ALL
00037 // WARRANTIES, see the file, "LICENSE.txt," in this distribution.
00038 // "Musimathics" is available here:     http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&tid=10916
00039 // Gareth Loy's Musimathics website:    http://www.musimathics.com/
00040 // The Musimat website:                 http://www.musimat.com/
00041 // This program is released under the terms of the GNU General Public License
00042 // available here:                      http://www.gnu.org/licenses/gpl.txt
00043 

Generated on Fri Nov 26 2010 16:18:25 for Musimat Tutorial by  doxygen 1.7.2