Next: options Up: MacAnova Help File Previous: NULL   Contents

number

Keywords: variables, syntax, missing values
You enter numbers as integers with or without out a decimal point, as
decimal numbers, or using exponential notation (X.XXeY or X.XXEY is XX.X
* 10^Y).

  Cmd> a <- 65535 # same as a <- 65535. or a <- 65535.0000

  Cmd> a <- -3141.592654; b <- .0000415; c <- 1000000

  Cmd> a <- -3.141592654e3; b <- 4.15E-5; c <- 1e6# same as preceding

For greater readability of long numbers, you can use '_' to separate
digits in the mantissa (the entire number without 'e' or 'E' or the part
before 'e' or 'E').

  Cmd> a <- -3_141.592_654e4 # same as a <- -3141.592654e4

Warning: _3_141, for example, is a legal variable name, not a number.

Fortran style double precision numbers like -3.14592654d3 and 4.15D-5
are read as if the 'd' or 'D' were 'e' (except by read() and matread()).

It is an error to attempt to enter a number that is too large to be
represented in the computer.  For example,

  Cmd> d <- 3.1e5000

is an error.  On most computers the largest numbers are about +-2^1024 =
+-1.79769e+308 and the smallest nonzero numbers are about +-2^(-1024) =
5.56268e-309.

You enter MISSING values using the symbol '?'.

  Cmd> e <- vector(1,2,3,?,4,5,?) # vector with 2 MISSING values.

Other representations for MISSING such as '*', 'NA' and '.' which are
recognized by vecread() are not recognized in MacAnova commands.

By default, most numeric output is printed using a hybrid between
integer, decimal and exponential format.  MISSING values are normally
printed as 'MISSING'.

  Cmd> vector(100*PI, 1e6*PI, PI/100, PI/1e6)
  (1)       314.16   3.1416e+06     0.031416   3.1416e-06

  Cmd> vector(34, ?)
  (1)           34      MISSING

You can change these defaults by setoptions() keywords 'format' and
'missing'.  Here is an example:

  Cmd> setoptions(missing:"NA", format:"12.4f")

  Cmd> vector(100*PI, 1e6*PI, PI/100, PI/1e6)
  (1)     314.1593 3141592.6536       0.0314       0.0000

  Cmd> vector(34, ?)
  (1)      34.0000           NA

See topics setoptions(), 'options', print().

See also topic 'syntax'.


Gary Oehlert 2003-01-15