real

Section: OATH Reference Manual (3O)
Updated: 26 August 1991
Index Return to Main Contents
 

NAME

real (realA, realG) - an object that holds a real number value  

SYNOPSIS

#include <oath/numeric.h>  

DESCRIPTION

The real is an object that holds a real numeric value. Note that real and the other numeric types in OATH are object-oriented like bag, as opposed to value-oriented like int or float -- see complex(3O).  

DERIVATION

real : complex : obj

real is an abstract type.  

STATIC OPERATIONS

realA realA:: isa (objA)
realA::isa(O) returns O if it is truly a real; otherwise it returns Nil.
 

MEMBER OPERATIONS

integerA realA:: makeFloor (int = FALSE)
R.makeFloor() makes and returns an integer representing the closest integer value that is less than or equal to R (rounds toward negative infinity).
integerA realA:: makeCeiling (int = FALSE)
R.makeCeiling() makes and returns an integer representing the closest integer value that is greater than or equal to R (rounds toward positive infinity).
integerA realA:: makeTruncate (int = FALSE)
R.makeTruncate() makes and returns an integer representing the closest integer value to R whose absolute value is less than the absolute value of R (rounds toward zero).
integerA realA:: makeRound (int = FALSE)
R.makeRound() makes and returns an integer representing the closest integer value to R. In case of exact tie in closeness, the larger integer is chosen.
int realA:: sign ()
R.sign() returns -1 if R is less than zero, 0 if R isZero, or 1 if R is greater than 0.
int realA:: hasPositive ()
R.hasPositive() returns TRUE if R has a value greater than 0.
int realA:: hasNegative ()
R.hasNegative() returns TRUE if R has a value less than 0.
int realA:: operator <= (realA)
C1 <= C2 returns TRUE if C1 is less than or equal to C2.
int realA:: operator < (realA)
C1 < C2 returns TRUE if C1 is less than C2.
int realA:: operator > (realA)
C1 > C2 returns TRUE if C1 is greater than C2.
int realA:: operator >= (realA)
C1 >= C2 returns TRUE if C1 is greater than or equal to C2.
int realA:: hasDouble ()
R.isDouble() returns TRUE if R is within the range of double.
double realA:: makeDouble ()
R.makeDouble() returns the nearest double value to R.
realA realA:: min (realA)
R1.min(R2) sets R1 to the value of R2 if R2 was less than R1.
realA realA:: max (realA)
R1.max(R2) sets R1 to the value of R2 if R2 was more than R1.
 

INTERNAL OPERATIONS

const signMagnitudeP& realA:: smMantissa ()
R.smMantissa() returns an extended-precision, sign-magnitude representation of the mantissa of the value of R.
const signMagnitudeP& realA:: smExponent ()
R.smExponent() returns an extended-precision, sign-magnitude representation of the power-of-2 exponent of the value of R. That is, it returns the number of bits that the mantissa, taken as an integer value, must be shifted left or right (left is positive, right negative) to obtain the real value.
 

SEE ALSO

OATH(3O), complex(3O), rational(3O), integer(3O), bigInteger(3O)  

AUTHOR

Brian M. Kennedy (Computer Science Center, Texas Instruments Incorporated)  

COPYRIGHT

Copyright (C) 1991 Texas Instruments Incorporated

Permission is granted to any individual or institution to use, copy, modify, and distribute this software, provided that this complete copyright and permission notice is maintained, intact, in all copies and supporting documentation. Texas Instruments Incorporated provides this software "as is" without express or implied warranty.  

BUGS

There is only one implementation of real provided, and it only supports integer precision. Thus, all the difficulties in implementing cross-implementations of functionality may not be readily apparent. Thus, this interface may need augmentation to better support implementations. Planned implementations include doubleReal, floatReal, bigReal, bigRational, dlongRational, longRational, bigInteger, dlongInteger, and longInteger.


 

Index

NAME
SYNOPSIS
DESCRIPTION
DERIVATION
STATIC OPERATIONS
MEMBER OPERATIONS
INTERNAL OPERATIONS
SEE ALSO
AUTHOR
COPYRIGHT
BUGS

This document was created by man2html, using the manual pages.
Time: 20:37:46 GMT, July 24, 2024