#include <YCPFloat.h>
Public Member Functions | |
double | value () const |
YCPOrder | compare (const YCPFloat &v) const |
string | toString () const |
std::ostream & | toStream (std::ostream &str) const |
std::ostream & | toXml (std::ostream &str, int indent) const |
YCPValueType | valuetype () const |
Protected Member Functions | |
YCPFloatRep (double v) | |
YCPFloatRep (const char *r) | |
Private Attributes | |
double | v |
Friends | |
class | YCPFloat |
YCP Syntax: Like in C. The decimal point is obligatory.
1.0, -0.6, 0.9e-16, ...
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
r | string like '18.8e-17' |
References v.
Compares two YCPFloats for equality, greaterness or smallerness.
v | value to compare against |
References v, YO_EQUAL, YO_GREATER, and YO_LESS.
std::ostream & YCPFloatRep::toStream | ( | std::ostream & | str | ) | const [virtual] |
Output value as bytecode to stream
Implements YCPElementRep.
References toString(), and Bytecode::writeString().
string YCPFloatRep::toString | ( | void | ) | 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.
References v.
Referenced by toStream(), and toXml().
std::ostream & YCPFloatRep::toXml | ( | std::ostream & | str, | |
int | indent | |||
) | const [virtual] |
double YCPFloatRep::value | ( | ) | const |
Returns the value of this object in form of a C value of type double.
References v.
YCPValueType YCPFloatRep::valuetype | ( | ) | const [virtual] |
friend class YCPFloat [friend] |
double YCPFloatRep::v [private] |
Referenced by compare(), toString(), value(), and YCPFloatRep().