|
|
Number is a handle for a number value. KJSO::toPrimitive(), KJSO::toBoolean(), KJSO::toNumber(), KJSO::toString() and KJSO::toString() are re-implemented internally according to the specification.
Example usage:
Number a(2), b(3.0), c; // c defaults to 0.0 c = a.value() * b.value(); // c will be 6.0 now String s = c.toString(); // s holds "6" |
Note the following implementation detail: Internally, the value is stored as a double and will be casted from and to other types when needed. This won't be noticable within a certain range of values but might produce unpredictable results when crossing these limits. In case this turns out to be a real problem for an application we might have to extend this class to behave more intelligently.
|
Construct a Number type from an integer.
|
Construct a Number type from an unsigned integer.
|
Construct a Number type from a double.
|
Construct a Number type from a long int.
|
Construct a Number type from a long unsigned int.
~ |
[virtual]
Destructor.
double |
[const]
Returns: The internally stored value.
int |
[const]
Convenience function.
Returns: The internally stored value converted to an int.
bool |
[const]
Returns: True is this is not a number (NaN).
bool |
[const]
Returns: True if Number is either +Infinity or -Infinity.
Generated by: baudens@ke.mandrakesoft.com on Thu Oct 26 17:36:53 2000, using kdoc 2.0a40. |