eX version 0.4b User's Manual                         File eXMan16.txt
(C) Copyright 1995, 1996 William E. Wilgus III.   All rights reserved.


Data Type Cast & Radix Functions

Cast Functions

Each of the four data type cast functions can serve three purposes: 

   1. Coercion of a numeric argument to values within the range of the
      data type of the function (providing the capacity is not
      exceeded),  
   2. Conversion of a numeric argument to a string containing the
      internal storage format of the argument, or  
   3. Conversion of a string argument that contains a number
      represented in the internal storage format indicated by the
      function to a numeric.  

Although not usually thought of as cast functions, this seemed to be
the place to include the string to numeric (val) and numeric to string
(str) functions, and the numeric to string radix oct.  So this is
where I put them.  (Hex is a hermaphrodite function, so that's where 
it is.) These latter 3 functions take the form 

                    function base10number#

double
                         double eev#
     Returns the double precision floating-point value of eev#.  This
     use is superflous (at least in this implementation) as all
     numeric eev#s are double precision floating-point.

                         double$ eev#
     Returns an 8-byte string containing the double-precision
     floating-point value of the argument in IEEE format.

                    double 8ByteIEEEdouble$
     Returns the value contained in the 8-byte IEEE numeric format
     double string.  eX aborts if the length of the argument string is
     not 8 bytes. 

long
                              long eev#
     Returns eev# rounded to long integer (-2,147,483,648 to
     2,147,483,647).  eX will abort if an overflow occurs.

                              long$ eev#
     Returns a 4-byte string containing the rounded to long integer
     value of eev# in internal stroage format. eX will abort if an
     overflow occurs.

                         long 4ByteISFlong$
     Returns the value contained in the 4-byte internal storage format
     string. eX aborts if the length of the argument string is not 4
     bytes. 

oct
                              oct eev#
     Returns a string containing the octal representation of eev#, 
     which must be within the range of data type long. 

short
                              short eev#
     Returns eev# rounded to signed short integer (-32768 to 32767).
     eX will abort if an overflow occurs.

                              short$ eev#
     Returns a 2-byte string containing the rounded to short integer
     value of eev# in internal stroage format.  eX will abort if an
     overflow occurs.

                         short 2ByteISFshort$
     Returns the value contained in the 2-byte internal storage format
     string.  eX aborts if the length of the argument string is not 2
     bytes. 

single
                              short eev#
     Returns the rounded if necessary single precision floating-point
     value of eev#.  eX will abort if an overflow occurs.

                              single$ eev#
     Returns a 4-byte string containing the single-precision
     floating-point value of eev# in IEEE format.  eX will abort if an
     overflow occurs.

                         single 4ByteISFsingle$
     Returns the value contained in the 4-byte IEEE numeric format
     single string.  eX aborts if the length of the argument string is
     not 4 bytes. 

str
                              str eev#
     Returns a string containing the un-formatted ASCII representation
     of the argument.  The string will contain a leading space if the
     argument is positive. 

val
                              val eev$
     Returns the value of the optionally formatted ASCII
     representation numeric at the beginning of eev$; or if not at the
     beginning, extracted via a sub-string function.  The format may
     include leading asterisks (*), dollar signs ($) and numeric signs
     (+ -), and commas and trailing numeric signs. 


Radix Functions

Numeric literal arguments, of course, must be base 10 representation. 
Whitespace may not exist between the radix function and its
designator, but may exist between the radix designator and its
argument.  Unless stated otherwise, the argument may include a
fractional part.  The following example typifies their form: 

                             &c Celsius#


&C or &c
     Celsius to fahrenheit conversion.

&D or &d
     Degrees of arc to radians conversion.

&F or &f
     Fahrenheit to celsius conversion.

&M or &m
     Minutes of arc to radians conversion.

&R or &r
     Radians to degrees of arc conversion.

&S or &s
     Seconds of arc to radians conversion.
