Go to the previous, next section.
#include <nihcl/Float.h>
Class
Float
provides an NIH Class Library object to hold a floating point number. This is useful, for example, if one wishes to associate a key object with a floating point number and store it in a
Dictionary
. Arithmetic operations on
Float
objects have not been provided to discourage their use, due to their relative inefficiency.
Float(double
value
=0)
Float
with the value
value.
Float(istream&
strm)
Float
with the value read from the input stream
strm
with
istream::operator>>()
.
double value() const
Float
.
double value(double
newValue)
Float
to
newValue
and returns
newValue.
virtual unsigned hash() const
virtual int compare(const Object&
ob) const
Float
with the argument object
ob, which must also be an instance of class
Float
. Returns a negative result if this
Float
is less than
ob, zero if this
Float
equals
ob, and a positive result if this
Float
is greater than
ob.
virtual bool isEqual(const Object&
ob) const
YES
if
ob
is of species
Float
and equals this
Float
.
virtual void deepenShallowCopy()
Float
.
virtual void printOn(ostream&
strm
=cout) const
Float
on output stream
strm
using
ostream::operator<<()
.
virtual void scanFrom(istream&
strm)
Float
to the value obtained by reading the input stream
strm
with
istream::operator>>()
.
virtual const Class* species() const
Float
.
virtual void storer(OIOofd&
fd) const
virtual void storer(OIOout&
strm) const
Float
on
fd
or
strm.
Go to the previous, next section.