yast2-core
|
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>
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 |
![]() | |
const char * | valuetype_str () const |
bool | isVoid () const |
bool | isBoolean () const |
bool | isInteger () const |
bool | isFloat () const |
bool | isString () const |
bool | isByteblock () const |
bool | isPath () const |
bool | isSymbol () const |
bool | isList () const |
bool | isTerm () const |
bool | isMap () const |
bool | isCode () const |
bool | isBreak () const |
bool | isReturn () const |
bool | isEntry () const |
bool | isReference () const |
bool | isExternal () const |
YCPVoid | asVoid () const |
YCPBoolean | asBoolean () const |
YCPInteger | asInteger () const |
YCPFloat | asFloat () const |
YCPString | asString () const |
YCPByteblock | asByteblock () const |
YCPPath | asPath () const |
YCPSymbol | asSymbol () const |
YCPList | asList () const |
YCPTerm | asTerm () const |
YCPMap | asMap () const |
YCPCode | asCode () const |
YCPEntry | asEntry () const |
YCPReference | asReference () const |
YCPExternal | asExternal () const |
bool | equal (const YCPValue &) const |
YCPOrder | compare (const YCPValue &v, bool rl=false) const |
![]() | |
YCPValue | asValue () const |
virtual const YCPElementRep * | shallowCopy () const |
Protected Member Functions | |
YCPFloatRep (double v) | |
YCPFloatRep (const char *r) | |
![]() | |
YCPElementRep () | |
virtual | ~YCPElementRep () |
Private Attributes | |
double | v |
Friends | |
class | YCPFloat |
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, ...
|
protected |
Creates a new YCPFloatRep object with the value given in v.
|
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.
|
virtual |
Output value as bytecode to stream
Implements YCPElementRep.
References toString(), and Bytecode::writeString().
|
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().
|
virtual |
Implements YCPValueRep.
References toString().
double YCPFloatRep::value | ( | ) | const |
Returns the value of this object in form of a C value of type double.
References v.
|
virtual |
|
friend |
Referenced by YCPFloat::YCPFloat().
|
private |
Referenced by compare(), fromStream(), toString(), value(), and YCPFloatRep().