General Modularity Example Module Projects & Files Commands & Scripting
Windows Menus Charts Tables Buttons & tools
Trees and Taxa Characters & Models Documentation General Utilities
Utility classes and interfaces Numbers Strings

Numbers

(February 2001)

Mesquite provides utility classes for dealing with numbers. Some, such as MesquiteInteger, MesquiteLong and MesquiteDouble, are basically wrapper classes to allow the equivalent of a VAR parameter to be passed and its content changed by a method. They also provide various helping methods concerning minimum, maximum, String reading and writing, and so on. MesquiteDouble provides String output with more flexibility than the standard Double class.

For int, long and double variable types Mesquite defines some constant values to signify "unassigned", "infinity", "negative infinity", and "impossible". These constants are in the respective wrapper classes MesquiteInteger, MesquiteLong and MesquiteDouble.

The MesquiteNumber class is a special class to hold numerical information without specifying type (integer, long or double). It has storage for each, and by default stores as integer (hence, with full precision). If operations involve long or doubles, the storage gets "upgraded" accordingly. Many Mesquite calculations use MesquiteNumbers (or the corresponding NumberArray or Number2DArray) to avoid locking in to a particular numerical storage type.

Some related classes are available for arrays. For one-dimensional arrays, use NumberArray, LongArray and DoubleArray. For two-dimensional arrays, use Number2DArray, Long2DArray and Double2DArray.


© W. Maddison & D. Maddison 1999-2001