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


Hermaphrodite Functions
 
The hermaphrodite functions are so called because their (fundamental) 
argument may be either a numeric or alpha-numeric.  
 
bin
                             bin(eev)
     Returns a string containing the binary representation of eev.
     The un-parenthesized form is not allowed.  Numerics are
     automatically normalized, i.e., presented in msb ... lsb order;
     however, all numerics, regardless of data type, are returned
     as data type double but the implied bit of the IEEE format is not
     inserted.  The following arguments will provide the correct
     non-double representation  for numeric literals

                    chr eev#
                    msblsb short$ eev$
                    msblsb long$ eev$
                    msblsb single$ eev$

bit  (Not available in eX Lite.)
               bit<<$>>(eev, BitNumber#) <<:= eev#>>
     Returns the status of bit BitNumber# within eev:  set returns
     true (-1), not set returns false (0).  If the string suffix $ is
     used, a 1 character string representation of the binary value of
     the bit (either 1 or 0) is returned.  It is assignable, except
     for sequential files; and any assignment value other than the
     numeric 0 (reset bit) is taken to be 1 (set bit).  
 
     Bits within numerics are numbered from right (0) to left, and
     numerics are automatically normalized prior to retrieving the bit
     value, or in other words, the bit argument for a numeric value
     should be given as though numerics were stored in msb ... lsb
     order.  Bits within strings are numbered 0 through 7 within a
     byte,  and bytes are numbered from left (byte 0) to left.  The
     formula

               ((ByteNumber# - 1) * 8) + BitNumber#

     may be used to calculate the bit argument for a string.  
 
     Special values may be represented in IEEE floating-point formats.

     These are the positives and negatives  


                         NAN    Not-A-Number,
                         IND    Indeterminate, and
                         INF    Infinity.

     No provisions are made for their use in this version of eX, and
     therefore no further information is provided.

diff  (Not available in eX Lite.)
                         diff(eev1, eev2)
     Difference function.  Returns a signed numeric value to indicate
     any difference between the two arguments.  If both arguments are
     numeric, the numeric difference is returned; a positive value
     indicating that the first argument is greater than the second, a
     negative value indicating the opposite.  If both arguments are
     strings, a positive value again indicates that the first
     argument is greater than the second and a negative value
     indicates the opposite; the magnitude indicates the string
     character position where the difference begins.  In the case of
     strings of un-equal lengths that are equal to the end of the
     shortest string, the magnitude is the length of the shorter
     string plus 1.  If one argument is numeric and the other is a
     string, the difference between the numeric and the length of the
     string is returned, with the sign of the returned value again
     indicating which argument is the greater/lesser.   Note that
     neither argument can accept both a string and a numeric. 

even  (Not available in eX Lite.)
                              even eev
     If placed within and at the level of a conditional test, 
     even functions as a unary logical operator.  Otherwise, it
     returns true (-) if a numeric argument is evenly divisible by 2
     or the length of a string argument is evenly divisible by 2,
     false (0) if not.  If both eev types are made available to the
     function, both must be `even' for the function (or `operator') to
     return true. 

hex
                              hex eev
     Returns a string containing the represention of eev in
     hexadecimal notation.  If the argument is a numeric, it is forced
     to a long prior to conversion.

max  (Not available in eX Lite.)
                         max eev<<, eev ... >>
     Returns the largest value(s) within the argument list.  The
     argument data class may be numeric, alpha-numeric, or both
     (including simultaneously).  If both, returns both the largest
     numeric and the largest string in the list.  

          max (1 + "two"), (3 + "four")   returns   3 and "two"

min  (Not available in eX Lite.)
                         min eev<<, eev ...>>
     Returns the smallest value(s) within the argument list.  The
     argument data class may be numeric, alpha-numeric, or both
     (including simultaneously).  If both, it returns both the
     smallest numeric and the smallest string in the list. 

          min (1 + "two"), (3 + "four")   returns   1 and "four"

MsbLsb  (Not available in eX Lite.)
                         MsbLsb eev
     Returns a string containing a copy of the argument eev with the
     order of the bytes reversed.  It is primarily intended for the
     normalization of numerics, but may be utilized with a string. 

                MsbLsb "12"    returns    "21"

null
     Null function.  Returns both the numeric value 0 and the null
     string "".   It is provided as an alternative to the aggregations
     (;), and []. 

odd  (Not available in eX Lite.)
                              odd eev
     If placed within and at the level of a conditional test, odd
     functions as a unary logical operator.  Otherwise, it returns
     true (-1) if a numeric argument is not evenly divisible by 2 or
     the length of a string argument is not evenly divisible by 2;
     false (0) otherwise.  If both eev types are made available to the
     function, both must be `odd' for the function (or `operator') to
     return true. 

rol  (Not available in eX Lite.)
                         rol(eev, bits#)
     Rotates eev left by bits#.  If the argument is a data entity
     (except a sequential file) rather than a literal, it is an
     assignment in itself.  Note that data entity or literal numerics
     (which are considered to be  data type double) are automatically
     normalized prior to rotation.  To rotate the non-double format of
     a numeric literal, MsbLsb the cast to string of the literal, as
     in

                      msblsb short$ eev#
                      msblsb long$ eev#
                      msblsb single$ eev#

ror  (Not available in eX Lite.)
                         ror(eev, bits#)
     Rotates eev right by bits#.  If the argument is a data entity
     (except a sequential file) rather than a literal, it is an
     assignment in itself.  Note that data entity or literal numerics
     (which are considered to be of data type double) are
     automatically normalized prior to rotation.  To rotate the
     non-double format of a numeric literal, MsbLsb the cast to
     string of the literal, as shown for rol.

shiftL  (Not available in eX Lite.)
                    shiftL(eev, bits#, BitValue#)
     Shifts eev left by bits#, replacing the bits vacated by the 
     shift with BitValue# bits (0 or 1).  If the argument is a data
     entity (except a sequential file) rather than a literal, it is an
     assignment in itself.  Note that data entity or literal numerics
     (which are considered to be of data type double) are
     automatically normalized prior to shifting.  To shift the
     non-double format of a numeric literal, MsbLsb the cast to string
     of the literal, as shown for rol.

shiftR  (Not available in eX Lite.)
                    shiftR(eev, bits#, BitValue#) 
     Shifts eev right by bits#, replacing the bits vacated by the
     shift with BitValue# bits (0 or 1).  If the argument is a data
     entity (except a sequential file) rather than a literal, it is an
     assignment in itself.  Note that data entity or literal numerics
     (which are considered to be of data type double) are
     automatically normalized prior to shifting.  To shift the
     non-double format of a numeric literal, MsbLsb the cast to string
     of the literal, as shown for rol.

word
                    word(eev, n#) <<:= eev#>>
     Returns the numeric value of the n#th word (2 bytes), which is
     considered to be a data type short, from within eev#.  If the
     string suffix $ is used, returns a string containing the  
     binary representation of the word.  Words within strings are
     numbered from left (1) to right.  Words within numerics are
     numbered from right (1) to left, and no compensation should be
     made for the lsb ... msb order of storage of numerics.  It is
     assignable except for sequential files.

