YCPFloatRep Class Reference

YCPValueRep representing a floating point number. The precision of the floating point number a YCPFloatRep is representing is not specified, because it would be very difficult to guarantee a certain precision platform independently and because this is not neccessary. More...

#include <YCPFloat.h>

Inheritance diagram for YCPFloatRep:

YCPValueRep YCPElementRep List of all members.

Public Member Functions

double value () const
YCPOrder compare (const YCPFloat &v) const
string toString () const
std::ostream & toStream (std::ostream &str) const
YCPValueType valuetype () const

Protected Member Functions

 YCPFloatRep (double v)
 YCPFloatRep (const char *r)

Private Attributes

double v

Friends

class YCPFloat

Detailed Description

YCPValueRep representing a floating point number. The precision of the floating point number a YCPFloatRep is representing is not specified, because it would be very difficult to guarantee a certain precision platform independently and because this is not neccessary.

YCP Syntax: Like in C. The decimal point is obligatory.

1.0, -0.6, 0.9e-16, ...


Constructor & Destructor Documentation

YCPFloatRep::YCPFloatRep double  v  )  [protected]
 

Creates a new YCPFloatRep object with the value given in v.

YCPFloatRep::YCPFloatRep const char *  r  )  [protected]
 

Creates a new YCPFloatRep object from its ASCII representation

Parameters:
r string like '18.8e-17'


Member Function Documentation

YCPOrder YCPFloatRep::compare const YCPFloat v  )  const
 

Compares two YCPFloats for equality, greaterness or smallerness.

Parameters:
v value to compare against
Returns:
YO_LESS, if this is smaller than v, YO_EQUAL, if this is equal to v, YO_GREATER, if this is greater to v

std::ostream & YCPFloatRep::toStream std::ostream &  str  )  const [virtual]
 

Output value as bytecode to stream

Implements YCPElementRep.

string YCPFloatRep::toString  )  const [virtual]
 

Returns an ASCII representation of this value. Note that this must alway contain either a decimal point, or an exponent symbol in order to keep up the axiom, that the syntactical representation of a YCP value uniquely describes its type. Examples: 0.0, 1e10, -17.0e8

Implements YCPElementRep.

double YCPFloatRep::value  )  const
 

Returns the value of this object in form of a C value of type double.

YCPValueType YCPFloatRep::valuetype  )  const [virtual]
 

Returns YT_FLOAT. See YCPValueRep::type.

Implements YCPValueRep.


Friends And Related Function Documentation

friend class YCPFloat [friend]
 


Member Data Documentation

double YCPFloatRep::v [private]
 


The documentation for this class was generated from the following files:
Generated on Fri Jun 16 18:07:46 2006 for yast2-core by  doxygen 1.4.6