#include <NumberStringClass.hpp>
Static Public Member Functions | |
static RexxNumberString * | newInstanceFromDouble (double) |
static RexxNumberString * | newInstanceFromDouble (double, size_t) |
static RexxNumberString * | newInstanceFromFloat (float) |
static RexxNumberString * | newInstanceFromWholenumber (wholenumber_t) |
static RexxNumberString * | newInstanceFromInt64 (int64_t) |
static RexxNumberString * | newInstanceFromUint64 (uint64_t) |
static RexxNumberString * | newInstanceFromStringsize (stringsize_t) |
static RexxNumberString * | newInstance (const char *, stringsize_t) |
static void | createInstance () |
static size_t | highBits (size_t) |
static void | subtractNumbers (RexxNumberString *larger, const char *largerPtr, wholenumber_t aLargerExp, RexxNumberString *smaller, const char *smallerPtr, wholenumber_t aSmallerExp, RexxNumberString *result, char **resultPtr) |
static char * | addMultiplier (char *, size_t, char *, int) |
static char * | subtractDivisor (char *data1, size_t length1, char *data2, size_t length2, char *result, int Mult) |
static char * | multiplyPower (char *leftPtr, RexxNumberStringBase *left, char *rightPtr, RexxNumberStringBase *right, char *OutPtr, size_t OutLen, size_t NumberDigits) |
static char * | dividePower (char *AccumPtr, RexxNumberStringBase *Accum, char *Output, size_t NumberDigits) |
static char * | addToBaseSixteen (int, char *, char *) |
static char * | addToBaseTen (int, char *, char *) |
static char * | multiplyBaseSixteen (char *, char *) |
static char * | multiplyBaseTen (char *, char *) |
Static Public Member Functions inherited from RexxObject | |
static void | decodeMessageName (RexxObject *target, RexxObject *message, RexxString *&messageName, RexxObject *&startScope) |
static void | createInstance () |
Static Public Member Functions inherited from RexxInternalObject | |
static size_t | getObjectHeaderSize () |
Public Attributes | |
char | number [4] |
Public Attributes inherited from RexxNumberStringBase | |
RexxString * | stringObject |
short | NumFlags |
short | sign |
size_t | NumDigits |
wholenumber_t | exp |
size_t | length |
Public Attributes inherited from RexxInternalObject | |
ObjectHeader | header |
RexxBehaviour * | behaviour |
Static Public Attributes | |
static PCPPM | operatorMethods [] |
static RexxClass * | classInstance = OREF_NULL |
Static Public Attributes inherited from RexxObject | |
static PCPPM | operatorMethods [] |
static RexxClass * | classInstance = OREF_NULL |
Additional Inherited Members | |
Protected Member Functions inherited from RexxVirtualBase | |
virtual | ~RexxVirtualBase () |
virtual void | baseVirtual () |
Definition at line 93 of file NumberStringClass.hpp.
RexxNumberString::RexxNumberString | ( | size_t | len | ) |
Constructor for a new number string value.
len | The length we require for the value. |
Definition at line 86 of file NumberStringClass.cpp.
References Numerics::FORM_SCIENTIFIC, RexxNumberStringBase::length, number_digits(), number_form(), RexxNumberStringBase::NumDigits, RexxNumberStringBase::NumFlags, NumFormScientific, and RexxNumberStringBase::sign.
Referenced by addSub().
RexxNumberString::RexxNumberString | ( | size_t | len, |
size_t | precision | ||
) |
Create a number string for a given digits precision
len | The length of value we need to accomodate |
precision | The precision to be used for formatting. |
Definition at line 104 of file NumberStringClass.cpp.
References Numerics::FORM_SCIENTIFIC, RexxNumberStringBase::length, number_form(), RexxNumberStringBase::NumDigits, RexxNumberStringBase::NumFlags, NumFormScientific, and RexxNumberStringBase::sign.
|
inline |
Definition at line 104 of file NumberStringClass.hpp.
RexxNumberString * RexxNumberString::abs | ( | void | ) |
Definition at line 3311 of file NumberStringClass.cpp.
References clone(), setupNumber(), and RexxNumberStringBase::sign.
Referenced by RexxInteger::abs(), RexxString::abs(), and RexxMemory::createImage().
|
static |
Definition at line 58 of file NumberStringMath2.cpp.
Referenced by Multiply(), and multiplyPower().
RexxNumberString * RexxNumberString::addSub | ( | RexxNumberString * | other, |
unsigned int | operation, | ||
size_t | NumberDigits | ||
) |
Definition at line 465 of file NumberStringMath.cpp.
References adjustPrecision(), buffer_alloc, clone(), RexxNumberStringBase::exp, FASTDIGITS, RexxNumberStringBase::length, new_numberstring(), number, OT_MINUS, OT_PLUS, reportCondition(), RexxNumberString(), setupNumber(), RexxNumberStringBase::sign, and subtractNumbers().
|
static |
Definition at line 1120 of file NumberStringMath.cpp.
Referenced by d2xD2c().
|
static |
Definition at line 1190 of file NumberStringMath.cpp.
Referenced by RexxString::x2dC2d().
void RexxNumberString::adjustPrecision | ( | ) |
Definition at line 212 of file NumberStringMath.cpp.
References Numerics::DEFAULT_DIGITS, Error_Overflow_expoverflow, Error_Overflow_expunderflow, RexxNumberStringBase::exp, RexxNumberStringBase::length, RexxNumberStringBase::mathRound(), Numerics::MAX_EXPONENT, Numerics::MIN_EXPONENT, number, RexxNumberStringBase::NumDigits, reportException(), and setZero().
Referenced by checkPrecision().
void RexxNumberString::adjustPrecision | ( | char * | resultPtr, |
size_t | NumberDigits | ||
) |
Definition at line 325 of file NumberStringMath.cpp.
References Numerics::DEFAULT_DIGITS, Error_Overflow_expoverflow, Error_Overflow_expunderflow, RexxNumberStringBase::exp, RexxNumberStringBase::length, RexxNumberStringBase::mathRound(), Numerics::MAX_EXPONENT, Numerics::MIN_EXPONENT, number, number_form(), reportException(), setNumericSettings(), setZero(), and RexxNumberStringBase::stripLeadingZeros().
Referenced by addSub(), and Multiply().
RexxObject * RexxNumberString::andOp | ( | RexxObject * | operand | ) |
Definition at line 2742 of file NumberStringClass.cpp.
References RexxString::andOp(), and stringValue().
Referenced by RexxMemory::createImage().
RexxObject * RexxNumberString::ceiling | ( | ) |
Return the ceiling value for a decimal numeric value. The ceiling is the first full number value greater that the current value. If the number has no significant decimal positions, this returns the same value (minus any trailing decimal zeros). NOTE: If the number is negative, the value goes toward the higher number (e.g., the ceiling of -3.5 is -3, not -4).
Definition at line 1617 of file NumberStringClass.cpp.
References ceilingInternal(), number_digits(), prepareNumber(), and ROUND.
Referenced by RexxString::ceiling(), and RexxMemory::createImage().
RexxObject * RexxNumberString::ceilingInternal | ( | ) |
Calculate the ceiling value for a number.
Definition at line 1629 of file NumberStringClass.cpp.
References RexxNumberStringBase::exp, IntegerOne, IntegerZero, RexxNumberStringBase::length, Numerics::minVal(), number, RexxNumberStringBase::sign, and truncInternal().
Referenced by ceiling().
bool RexxNumberString::checkIntegerDigits | ( | stringsize_t | numDigits, |
stringsize_t & | numberLength, | ||
wholenumber_t & | numberExponent, | ||
bool & | carry | ||
) |
Definition at line 854 of file NumberStringClass.cpp.
References RexxNumberStringBase::exp, RexxNumberStringBase::length, and number.
Referenced by int64Value(), numberValue(), unsignedInt64Value(), and unsignedNumberValue().
|
inline |
Definition at line 168 of file NumberStringClass.hpp.
References RexxNumberStringBase::length, NOROUND, and prepareOperatorNumber().
Referenced by Division(), and Multiply().
|
inline |
Definition at line 183 of file NumberStringClass.hpp.
References adjustPrecision(), RexxNumberStringBase::length, and RexxNumberStringBase::NumDigits.
Referenced by setupNumber().
RexxClass * RexxNumberString::classObject | ( | ) |
Definition at line 3726 of file NumberStringClass.cpp.
References TheStringClass.
Referenced by RexxMemory::createImage().
RexxNumberString * RexxNumberString::clone | ( | ) |
Definition at line 115 of file NumberStringClass.cpp.
References RexxInternalObject::clone(), OREF_NULL, OrefSet, and RexxNumberStringBase::stringObject.
Referenced by abs(), addSub(), Division(), prepareNumber(), prepareOperatorNumber(), and Sign().
wholenumber_t RexxNumberString::comp | ( | RexxObject * | right, |
RexxString * | alternativeOperator = OREF_NULL , |
||
RexxInteger ** | alternativeOperatorResultPtr = NULL |
||
) |
Definition at line 2788 of file NumberStringClass.cpp.
References addSub(), ARG_ONE, RexxString::comp(), RexxNumberStringBase::exp, RexxNumberStringBase::length, RexxObject::messageSend(), number, number_digits(), number_fuzzydigits(), RexxObject::numberString(), OREF_NULL, OT_MINUS, reportCondition(), requiredArgument(), RexxNumberStringBase::sign, and stringValue().
Referenced by RexxString::comp(), RexxInteger::comp(), equal(), isGreaterOrEqual(), isGreaterThan(), isLessOrEqual(), isLessThan(), and notEqual().
|
virtual |
Wrapper around the compareTo() method that does string sort comparisons.
other | The other comparison object |
Reimplemented from RexxObject.
Definition at line 2667 of file NumberStringClass.cpp.
References RexxString::compareTo(), and stringValue().
RexxString * RexxNumberString::concat | ( | RexxObject * | other | ) |
Definition at line 2727 of file NumberStringClass.cpp.
References RexxString::concatRexx(), and stringValue().
RexxString * RexxNumberString::concatBlank | ( | RexxObject * | other | ) |
Definition at line 2719 of file NumberStringClass.cpp.
References RexxString::concatBlank(), and stringValue().
|
static |
Create initial class object at bootstrap time.
Definition at line 67 of file NumberStringClass.cpp.
References CLASS_CREATE.
Referenced by RexxMemory::createImage().
bool RexxNumberString::createUnsignedInt64Value | ( | const char * | thisnum, |
stringsize_t | intlength, | ||
int | carry, | ||
wholenumber_t | exponent, | ||
uint64_t | maxValue, | ||
uint64_t & | result | ||
) |
Definition at line 782 of file NumberStringClass.cpp.
References Numerics::DIGITS64.
Referenced by int64Value(), and unsignedInt64Value().
bool RexxNumberString::createUnsignedValue | ( | const char * | thisnum, |
stringsize_t | intlength, | ||
int | carry, | ||
wholenumber_t | exponent, | ||
uwholenumber_t | maxValue, | ||
uwholenumber_t & | result | ||
) |
Definition at line 708 of file NumberStringClass.cpp.
References Numerics::ARGUMENT_DIGITS.
Referenced by numberValue(), and unsignedNumberValue().
RexxString * RexxNumberString::d2c | ( | RexxObject * | _length | ) |
Definition at line 3440 of file NumberStringClass.cpp.
References d2xD2c().
Referenced by RexxMemory::createImage().
RexxString * RexxNumberString::d2x | ( | RexxObject * | _length | ) |
Definition at line 3430 of file NumberStringClass.cpp.
References d2xD2c().
Referenced by RexxMemory::createImage().
RexxString * RexxNumberString::d2xD2c | ( | RexxObject * | _length, |
bool | type | ||
) |
Definition at line 3465 of file NumberStringClass.cpp.
References addToBaseSixteen(), ARG_ONE, BufferLength(), Error_Incorrect_method_d2c, Error_Incorrect_method_d2x, Error_Incorrect_method_d2xd2c, RexxNumberStringBase::exp, RexxBuffer::getData(), IntToHexDigit(), RexxNumberStringBase::length, multiplyBaseSixteen(), new_buffer(), new_string(), number, number_digits(), optionalLengthArgument(), OVERFLOWSPACE, StringUtil::packHex(), reportException(), RexxNumberStringBase::sign, SIZE_MAX, and type.
Referenced by RexxString::d2c(), RexxInteger::d2c(), d2c(), RexxString::d2x(), RexxInteger::d2x(), and d2x().
RexxNumberString * RexxNumberString::divide | ( | RexxObject * | right | ) |
Definition at line 3234 of file NumberStringClass.cpp.
References ARG_ONE, Division(), Error_Conversion_operator, RexxObject::messageSend(), RexxObject::numberString(), OREF_NULL, OT_DIVIDE, reportException(), and requiredArgument().
Referenced by RexxMemory::createImage(), and RexxString::divide().
|
static |
Definition at line 943 of file NumberStringMath2.cpp.
References buffer_alloc, RexxNumberStringBase::exp, if(), RexxNumberStringBase::length, RexxNumberStringBase::RexxNumberStringBase(), RexxNumberStringBase::stripLeadingZeros(), and subtractDivisor().
Referenced by power().
RexxNumberString * RexxNumberString::Division | ( | RexxNumberString * | other, |
unsigned int | DivOP | ||
) |
Definition at line 293 of file NumberStringMath2.cpp.
References Numerics::abs(), buffer_alloc, checkNumber(), clone(), Error_Invalid_whole_number_intdiv, Error_Invalid_whole_number_rem, Error_Overflow_zero, RexxNumberStringBase::exp, FASTDIGITS, IntegerZero, RexxNumberStringBase::length, RexxNumberStringBase::mathRound(), NOROUND, number, number_digits(), OT_DIVIDE, OT_INT_DIVIDE, OT_REMAINDER, prepareOperatorNumber(), reportException(), RexxNumberStringBase::RexxNumberStringBase(), setupNumber(), RexxNumberStringBase::sign, and subtractDivisor().
Referenced by divide(), integerDivide(), and remainder().
|
virtual |
Reimplemented from RexxObject.
Definition at line 673 of file NumberStringClass.cpp.
References RexxString::getStringData(), and stringValue().
Referenced by RexxString::doubleValue().
RexxInteger * RexxNumberString::equal | ( | RexxObject * | other | ) |
Definition at line 2948 of file NumberStringClass.cpp.
References comp(), OREF_NULL, TheFalseObject, TheNilObject, and TheTrueObject.
Referenced by RexxMemory::createImage().
|
virtual |
Reimplemented from RexxInternalObject.
Definition at line 3451 of file NumberStringClass.cpp.
References RexxExpressionStack::push(), TRACE_PREFIX_LITERAL, and RexxActivation::traceIntermediate().
|
virtual |
Reimplemented from RexxObject.
Definition at line 158 of file NumberStringClass.cpp.
References cleanUpFlatten, flatten_reference, and setUpFlatten.
RexxObject * RexxNumberString::floor | ( | ) |
Return the floor value for a decimal numeric value. The floor is the first full number value less that the current value. If the number has no significant decimal positions, this returns the same value (minus any trailing decimal zeros). NOTE: If the number is negative, the value goes toward the lower number (e.g., the floor of -3.5 is -4, not -3).
Definition at line 1488 of file NumberStringClass.cpp.
References floorInternal(), number_digits(), prepareNumber(), and ROUND.
Referenced by RexxMemory::createImage(), and RexxString::floor().
RexxObject * RexxNumberString::floorInternal | ( | ) |
Calculate the floor value for a number.
Definition at line 1500 of file NumberStringClass.cpp.
References RexxNumberStringBase::exp, IntegerMinusOne, IntegerZero, RexxNumberStringBase::length, Numerics::minVal(), number, RexxNumberStringBase::sign, and truncInternal().
Referenced by floor().
int RexxNumberString::format | ( | const char * | _number, |
size_t | _length | ||
) |
Definition at line 2260 of file NumberStringClass.cpp.
References Numerics::abs(), ch_BLANK, ch_MINUS, ch_NINE, ch_PERIOD, ch_PLUS, ch_TAB, ch_ZERO, RexxNumberStringBase::exp, RexxNumberStringBase::length, Numerics::MAX_EXPONENT, number, roundUp(), SetNumberStringZero, setZero(), and RexxNumberStringBase::sign.
Referenced by newInstance(), and newInstanceFromDouble().
void RexxNumberString::formatInt64 | ( | int64_t | integer | ) |
Definition at line 2558 of file NumberStringClass.cpp.
References integer(), RexxNumberStringBase::length, number, setZero(), and RexxNumberStringBase::sign.
Referenced by newInstanceFromInt64().
RexxString * RexxNumberString::formatInternal | ( | size_t | integers, |
size_t | decimals, | ||
size_t | mathexp, | ||
size_t | exptrigger, | ||
RexxNumberString * | original, | ||
size_t | digits, | ||
bool | form | ||
) |
Definition at line 1874 of file NumberStringClass.cpp.
References Numerics::abs(), Error_Incorrect_method_before_oversize, Error_Incorrect_method_exponent_oversize, RexxNumberStringBase::exp, fill_digits(), Numerics::FORM_ENGINEERING, Numerics::formatWholeNumber(), RexxString::getWritableData(), RexxNumberStringBase::length, RexxNumberStringBase::mathRound(), number, raw_string(), reportException(), and RexxNumberStringBase::sign.
Referenced by formatRexx().
void RexxNumberString::formatNumber | ( | wholenumber_t | integer | ) |
Definition at line 2507 of file NumberStringClass.cpp.
References integer(), RexxNumberStringBase::length, Numerics::normalizeWholeNumber(), number, setZero(), and RexxNumberStringBase::sign.
Referenced by newInstanceFromWholenumber().
RexxString * RexxNumberString::formatRexx | ( | RexxObject * | Integers, |
RexxObject * | Decimals, | ||
RexxObject * | MathExp, | ||
RexxObject * | ExpTrigger | ||
) |
Definition at line 1843 of file NumberStringClass.cpp.
References ARG_FOUR, ARG_ONE, ARG_THREE, ARG_TWO, formatInternal(), number_digits(), number_form(), optionalNonNegative(), prepareNumber(), and ROUND.
Referenced by RexxMemory::createImage(), RexxInteger::format(), and RexxString::format().
void RexxNumberString::formatUnsignedInt64 | ( | uint64_t | integer | ) |
Definition at line 2614 of file NumberStringClass.cpp.
References integer(), RexxNumberStringBase::length, number, and setZero().
Referenced by newInstanceFromUint64().
void RexxNumberString::formatUnsignedNumber | ( | size_t | integer | ) |
Definition at line 2529 of file NumberStringClass.cpp.
References Numerics::formatStringSize(), integer(), RexxNumberStringBase::length, number, and setZero().
Referenced by newInstanceFromStringsize().
|
virtual |
Get the primitive hash value of this String object.
Reimplemented from RexxInternalObject.
Definition at line 135 of file NumberStringClass.cpp.
References RexxString::getHashValue(), and stringValue().
|
virtual |
Reimplemented from RexxInternalObject.
Definition at line 3707 of file NumberStringClass.cpp.
|
virtual |
Reimplemented from RexxInternalObject.
Definition at line 3717 of file NumberStringClass.cpp.
|
virtual |
Reimplemented from RexxInternalObject.
Definition at line 3687 of file NumberStringClass.cpp.
|
virtual |
Reimplemented from RexxInternalObject.
Definition at line 3697 of file NumberStringClass.cpp.
RexxObject * RexxNumberString::hashCode | ( | ) |
Exported version of the HASHCODE method for retrieving the object's hash.
Definition at line 3051 of file NumberStringClass.cpp.
References RexxObject::hash(), and new_string().
Referenced by RexxMemory::createImage().
|
virtual |
Reimplemented from RexxObject.
Definition at line 201 of file NumberStringClass.cpp.
References RexxObject::hasMethod(), and stringValue().
|
static |
|
virtual |
Retrieve the method instance for an object's defined method.
method_name | The method name. |
Reimplemented from RexxObject.
Definition at line 2696 of file NumberStringClass.cpp.
References RexxObject::instanceMethod(), and stringValue().
|
virtual |
Return a supplier containing the methods implemented by an object. Depending on the argument, this is either A) all of the methods, B) just the explicitly set instance methods, or C) the methods provided by a given class.
class_object | The target class object (optional). |
Reimplemented from RexxObject.
Definition at line 2713 of file NumberStringClass.cpp.
References RexxObject::instanceMethods(), and stringValue().
bool RexxNumberString::int64Value | ( | int64_t * | result, |
stringsize_t | numDigits | ||
) |
Definition at line 934 of file NumberStringClass.cpp.
References checkIntegerDigits(), createUnsignedInt64Value(), RexxNumberStringBase::exp, INT64_MAX, INT64_MIN, RexxNumberStringBase::length, number, and RexxNumberStringBase::sign.
Referenced by Numerics::int64Object(), Numerics::objectToInt64(), Numerics::objectToSignedInteger(), and Numerics::objectToWholeNumber().
RexxNumberString * RexxNumberString::integerDivide | ( | RexxObject * | right | ) |
Definition at line 3260 of file NumberStringClass.cpp.
References ARG_ONE, Division(), Error_Conversion_operator, RexxObject::messageSend(), RexxObject::numberString(), OREF_NULL, OT_INT_DIVIDE, reportException(), and requiredArgument().
Referenced by RexxMemory::createImage(), and RexxString::integerDivide().
|
virtual |
Reimplemented from RexxObject.
Definition at line 687 of file NumberStringClass.cpp.
References new_integer(), number_digits(), numberValue(), and TheNilObject.
Referenced by RexxString::integerValue().
|
virtual |
Reimplemented from RexxObject.
Definition at line 2752 of file NumberStringClass.cpp.
References Error_Logical_value_method, Error_No_result_object_message, RexxString::isEqual(), RexxInternalObject::isSubClassOrEnhanced(), OREF_NULL, reportException(), RexxObject::sendMessage(), stringValue(), and RexxObject::truthValue().
RexxInteger * RexxNumberString::isGreaterOrEqual | ( | RexxObject * | other | ) |
Definition at line 3012 of file NumberStringClass.cpp.
References comp(), OREF_NULL, TheFalseObject, TheNilObject, and TheTrueObject.
Referenced by RexxMemory::createImage().
RexxInteger * RexxNumberString::isGreaterThan | ( | RexxObject * | other | ) |
Definition at line 2980 of file NumberStringClass.cpp.
References comp(), OREF_NULL, TheFalseObject, TheNilObject, and TheTrueObject.
Referenced by RexxMemory::createImage(), and maxMin().
|
virtual |
Override for the normal isinstanceof method. This version allows the NumberStringClass to "lie" about being a string.
other | The comparison class |
Reimplemented from RexxObject.
Definition at line 2682 of file NumberStringClass.cpp.
References RexxObject::isInstanceOf(), and stringValue().
RexxObject * RexxNumberString::isInteger | ( | ) |
Definition at line 3375 of file NumberStringClass.cpp.
References RexxString::isInteger(), and stringValue().
Referenced by StringUtil::dataType().
RexxInteger * RexxNumberString::isLessOrEqual | ( | RexxObject * | other | ) |
Definition at line 3028 of file NumberStringClass.cpp.
References comp(), OREF_NULL, TheFalseObject, TheNilObject, and TheTrueObject.
Referenced by RexxMemory::createImage().
RexxInteger * RexxNumberString::isLessThan | ( | RexxObject * | other | ) |
Definition at line 2996 of file NumberStringClass.cpp.
References comp(), OREF_NULL, TheFalseObject, TheNilObject, and TheTrueObject.
Referenced by RexxMemory::createImage(), and maxMin().
|
virtual |
Reimplemented from RexxObject.
Definition at line 140 of file NumberStringClass.cpp.
References memory_mark, and RexxNumberStringBase::stringObject.
|
virtual |
Reimplemented from RexxObject.
Definition at line 149 of file NumberStringClass.cpp.
References memory_mark_general, and RexxNumberStringBase::stringObject.
|
virtual |
Convert an object to a logical value without raising an error.
result | The converted value. |
Reimplemented from RexxObject.
Definition at line 1129 of file NumberStringClass.cpp.
References RexxNumberStringBase::exp, RexxNumberStringBase::length, number, and RexxNumberStringBase::sign.
|
virtual |
Override for the default object makearray method.
Reimplemented from RexxObject.
Definition at line 196 of file NumberStringClass.cpp.
References RexxString::makeArray(), and stringValue().
|
virtual |
Reimplemented from RexxObject.
Definition at line 182 of file NumberStringClass.cpp.
References stringValue().
RexxNumberString * RexxNumberString::Max | ( | RexxObject ** | args, |
size_t | argCount, | ||
size_t | named_argCount | ||
) |
Definition at line 3353 of file NumberStringClass.cpp.
References maxMin(), and OT_MAX.
Referenced by RexxMemory::createImage(), RexxInteger::Max(), and RexxString::Max().
RexxNumberString * RexxNumberString::maxMin | ( | RexxObject ** | args, |
size_t | argCount, | ||
size_t | named_argCount, | ||
unsigned int | operation | ||
) |
Definition at line 59 of file NumberStringMath.cpp.
References ActivityManager::currentActivity, RexxActivationBase::digits(), Error_Incorrect_call_noarg, Error_Incorrect_method_number, RexxActivationBase::fuzz(), RexxActivity::getTopStackFrame(), isGreaterThan(), isLessThan(), new_integer(), RexxObject::numberString(), OREF_NULL, OT_MAX, prepareNumber(), prepareOperatorNumber(), reportException(), ROUND, RexxActivationBase::setFuzz(), and TheTrueObject.
RexxNumberString * RexxNumberString::Min | ( | RexxObject ** | args, |
size_t | argCount, | ||
size_t | named_argCount | ||
) |
Definition at line 3364 of file NumberStringClass.cpp.
References maxMin(), and OT_MIN.
Referenced by RexxMemory::createImage(), RexxInteger::Min(), and RexxString::Min().
RexxNumberString * RexxNumberString::minus | ( | RexxObject * | right | ) |
Definition at line 3175 of file NumberStringClass.cpp.
References addSub(), Error_Conversion_operator, RexxObject::messageSend(), number_digits(), RexxObject::numberString(), OREF_NULL, OT_MINUS, prepareOperatorNumber(), reportException(), ROUND, and RexxNumberStringBase::sign.
Referenced by RexxMemory::createImage(), and RexxString::minus().
RexxNumberString * RexxNumberString::Multiply | ( | RexxNumberString * | other | ) |
Definition at line 102 of file NumberStringMath2.cpp.
References addMultiplier(), adjustPrecision(), buffer_alloc, checkNumber(), RexxNumberStringBase::exp, FASTDIGITS, if(), RexxNumberStringBase::length, new_numberstring(), number, number_digits(), and RexxNumberStringBase::sign.
Referenced by multiply().
RexxNumberString * RexxNumberString::multiply | ( | RexxObject * | right | ) |
Definition at line 3210 of file NumberStringClass.cpp.
References ARG_ONE, Error_Conversion_operator, RexxObject::messageSend(), Multiply(), RexxObject::numberString(), OREF_NULL, reportException(), and requiredArgument().
Referenced by RexxMemory::createImage(), and RexxString::multiply().
|
static |
Definition at line 1154 of file NumberStringMath.cpp.
Referenced by d2xD2c().
|
static |
Definition at line 1228 of file NumberStringMath.cpp.
Referenced by RexxString::x2dC2d().
|
static |
Definition at line 883 of file NumberStringMath2.cpp.
References addMultiplier(), RexxNumberStringBase::exp, RexxNumberStringBase::length, and RexxNumberStringBase::sign.
Referenced by power().
|
static |
Definition at line 3746 of file NumberStringClass.cpp.
References format(), number, numberStringScan(), OREF_NULL, and setZero().
Referenced by new_numberstring().
|
static |
Definition at line 3794 of file NumberStringClass.cpp.
References number, and number_digits().
Referenced by new_numberstringFromDouble(), and newInstanceFromFloat().
|
static |
Create a numberstring from a double value using a given formatting precision.
number | The double number to convert |
precision | The precision to apply to the result. |
Definition at line 3812 of file NumberStringClass.cpp.
References format(), isnan, new_string(), number, prepareNumber(), and ROUND.
|
static |
Definition at line 3786 of file NumberStringClass.cpp.
References newInstanceFromDouble(), and number_digits().
Referenced by new_numberstringFromFloat().
|
static |
Definition at line 3869 of file NumberStringClass.cpp.
References Numerics::DIGITS64, formatInt64(), and integer().
Referenced by new_numberstringFromInt64().
|
static |
Definition at line 3856 of file NumberStringClass.cpp.
References Numerics::ARGUMENT_DIGITS, formatUnsignedNumber(), and integer().
Referenced by new_numberstringFromStringsize().
|
static |
Definition at line 3881 of file NumberStringClass.cpp.
References Numerics::DIGITS64, formatUnsignedInt64(), and integer().
Referenced by new_numberstringFromUint64().
|
static |
Definition at line 3844 of file NumberStringClass.cpp.
References Numerics::ARGUMENT_DIGITS, formatNumber(), and integer().
Referenced by new_numberstringFromWholenumber().
RexxInteger * RexxNumberString::notEqual | ( | RexxObject * | other | ) |
Definition at line 2964 of file NumberStringClass.cpp.
References comp(), OREF_NULL, TheFalseObject, TheNilObject, and TheTrueObject.
Referenced by RexxMemory::createImage().
RexxObject * RexxNumberString::notOp | ( | ) |
Definition at line 3337 of file NumberStringClass.cpp.
References RexxString::notOp(), and stringValue().
Referenced by RexxMemory::createImage().
|
inlinevirtual |
Reimplemented from RexxObject.
Definition at line 115 of file NumberStringClass.hpp.
|
virtual |
Reimplemented from RexxObject.
Definition at line 504 of file NumberStringClass.cpp.
References Numerics::DEFAULT_DIGITS, and numberValue().
|
virtual |
Reimplemented from RexxObject.
Definition at line 522 of file NumberStringClass.cpp.
References checkIntegerDigits(), createUnsignedValue(), RexxNumberStringBase::exp, RexxNumberStringBase::length, Numerics::maxValueForDigits(), number, and RexxNumberStringBase::sign.
Referenced by integerValue(), numberValue(), and RexxString::numberValue().
|
inline |
Definition at line 97 of file NumberStringClass.hpp.
|
inline |
Definition at line 98 of file NumberStringClass.hpp.
|
inline |
Definition at line 99 of file NumberStringClass.hpp.
|
inline |
Definition at line 96 of file NumberStringClass.hpp.
void * RexxNumberString::operator new | ( | size_t | size, |
size_t | length | ||
) |
Definition at line 3735 of file NumberStringClass.cpp.
References new_object(), RexxInternalObject::setHasNoReferences(), and T_NumberString.
RexxObject * RexxNumberString::operatorNot | ( | RexxObject * | right | ) |
Definition at line 3345 of file NumberStringClass.cpp.
References RexxString::notOp(), and stringValue().
RexxObject * RexxNumberString::orOp | ( | RexxObject * | operand | ) |
Definition at line 2737 of file NumberStringClass.cpp.
References RexxString::orOp(), and stringValue().
Referenced by RexxMemory::createImage().
RexxNumberString * RexxNumberString::plus | ( | RexxObject * | right | ) |
Definition at line 3132 of file NumberStringClass.cpp.
References addSub(), Error_Conversion_operator, Numerics::FORM_ENGINEERING, Numerics::FORM_SCIENTIFIC, RexxObject::messageSend(), number_digits(), number_form(), RexxObject::numberString(), RexxNumberStringBase::NumDigits, RexxNumberStringBase::NumFlags, NumFormScientific, OREF_NULL, OT_PLUS, prepareOperatorNumber(), reportException(), ROUND, and RexxNumberStringBase::stringObject.
Referenced by RexxMemory::createImage(), StringUtil::dataType(), and RexxString::plus().
RexxNumberString * RexxNumberString::power | ( | RexxObject * | PowerObj | ) |
Definition at line 682 of file NumberStringMath2.cpp.
References Numerics::abs(), ARG_ONE, buffer_alloc, dividePower(), Error_Invalid_whole_number_power, Error_Overflow_overflow, Error_Overflow_power, RexxNumberStringBase::exp, HIBIT, highBits(), IntegerOne, IntegerZero, RexxNumberStringBase::length, LONGBITS, LOWBITS, Numerics::MAX_EXPONENT, RexxObject::messageSend(), multiplyPower(), NOROUND, number, number_digits(), RexxObject::numberValue(), OREF_NULL, prepareOperatorNumber(), reportException(), requiredArgument(), and RexxNumberStringBase::sign.
Referenced by RexxMemory::createImage(), and RexxString::power().
RexxNumberString * RexxNumberString::prepareNumber | ( | size_t | NumberDigits, |
bool | rounding | ||
) |
Definition at line 389 of file NumberStringMath.cpp.
References clone(), RexxNumberStringBase::exp, RexxNumberStringBase::length, RexxNumberStringBase::mathRound(), number, number_form(), ROUND, and setNumericSettings().
Referenced by ceiling(), floor(), formatRexx(), maxMin(), newInstanceFromDouble(), round(), and trunc().
RexxNumberString * RexxNumberString::prepareOperatorNumber | ( | size_t | targetLength, |
size_t | numberDigits, | ||
bool | rounding | ||
) |
Prepare an operator numberstring to a given length, raising a LOSTDIGITS condition if the starting number will cause lost digits
targetLength | The target preparation length (>= numberDigits) |
numberDigits | The digits setting used to determine LOSTDIGITS conditions |
rounding | Inidicates whether rounding is to be performed if the target object is longer than the targetLength |
Definition at line 433 of file NumberStringMath.cpp.
References clone(), RexxNumberStringBase::length, RexxString::length, number_form(), reportCondition(), ROUND, and setNumericSettings().
Referenced by checkNumber(), Division(), maxMin(), minus(), plus(), and power().
|
virtual |
Reimplemented from RexxInternalObject.
Definition at line 210 of file NumberStringClass.cpp.
References OREF_NULL, RexxNumberStringBase::stringObject, and stringValue().
RexxNumberString * RexxNumberString::remainder | ( | RexxObject * | right | ) |
Definition at line 3285 of file NumberStringClass.cpp.
References ARG_ONE, Division(), Error_Conversion_operator, RexxObject::messageSend(), RexxObject::numberString(), OREF_NULL, OT_REMAINDER, reportException(), and requiredArgument().
Referenced by RexxMemory::createImage(), and RexxString::remainder().
RexxObject * RexxNumberString::round | ( | ) |
Round the number value depending on the value of the first decimal position using standard rounding rules. NOTE: this uses the same rules for floor and ceiling when determining how things are rounded. This is really defined as floor(number + .5). Thus 3.4 and -3.4 round to 3 and -3, since they end up calculating floor(3.9) and floor(-2.9), repectively.
Definition at line 1745 of file NumberStringClass.cpp.
References number_digits(), prepareNumber(), ROUND, and roundInternal().
Referenced by RexxMemory::createImage(), and RexxString::round().
RexxObject * RexxNumberString::roundInternal | ( | ) |
Calculate the rounded number value.
Definition at line 1756 of file NumberStringClass.cpp.
References RexxNumberStringBase::exp, IntegerZero, RexxNumberStringBase::length, number, RexxNumberStringBase::sign, and truncInternal().
Referenced by round().
void RexxNumberString::roundUp | ( | int | MSDigit | ) |
Definition at line 3391 of file NumberStringClass.cpp.
References ch_FIVE, ch_NINE, RexxNumberStringBase::exp, RexxNumberStringBase::length, and number.
Referenced by format().
|
inline |
Definition at line 184 of file NumberStringClass.hpp.
References Numerics::FORM_SCIENTIFIC, RexxNumberStringBase::NumDigits, RexxNumberStringBase::NumFlags, and NumFormScientific.
Referenced by adjustPrecision(), prepareNumber(), prepareOperatorNumber(), and setupNumber().
void RexxNumberString::setString | ( | RexxString * | stringObj | ) |
Definition at line 171 of file NumberStringClass.cpp.
References OrefSet, RexxInternalObject::setHasReferences(), and RexxNumberStringBase::stringObject.
Referenced by RexxString::createNumberString(), and RexxString::numberString().
|
inline |
Definition at line 193 of file NumberStringClass.hpp.
References checkPrecision(), number_digits(), number_form(), and setNumericSettings().
Referenced by abs(), addSub(), Division(), and Sign().
|
inline |
Definition at line 236 of file NumberStringClass.hpp.
References RexxNumberStringBase::exp, RexxNumberStringBase::length, number, and RexxNumberStringBase::sign.
Referenced by adjustPrecision(), format(), formatInt64(), formatNumber(), formatUnsignedInt64(), formatUnsignedNumber(), and newInstance().
RexxInteger * RexxNumberString::Sign | ( | ) |
Definition at line 3325 of file NumberStringClass.cpp.
References clone(), new_integer(), setupNumber(), and RexxNumberStringBase::sign.
Referenced by RexxMemory::createImage(), and RexxString::sign().
wholenumber_t RexxNumberString::strictComp | ( | RexxObject * | other | ) |
Definition at line 2773 of file NumberStringClass.cpp.
References RexxString::strictComp(), and stringValue().
Referenced by strictEqual(), strictGreaterOrEqual(), strictGreaterThan(), strictLessOrEqual(), strictLessThan(), and strictNotEqual().
RexxInteger * RexxNumberString::strictEqual | ( | RexxObject * | other | ) |
Definition at line 3058 of file NumberStringClass.cpp.
References strictComp(), TheFalseObject, TheNilObject, and TheTrueObject.
Referenced by RexxMemory::createImage().
RexxInteger * RexxNumberString::strictGreaterOrEqual | ( | RexxObject * | other | ) |
Definition at line 3108 of file NumberStringClass.cpp.
References strictComp(), TheFalseObject, TheNilObject, and TheTrueObject.
Referenced by RexxMemory::createImage().
RexxInteger * RexxNumberString::strictGreaterThan | ( | RexxObject * | other | ) |
Definition at line 3084 of file NumberStringClass.cpp.
References strictComp(), TheFalseObject, TheNilObject, and TheTrueObject.
Referenced by RexxMemory::createImage().
RexxInteger * RexxNumberString::strictLessOrEqual | ( | RexxObject * | other | ) |
Definition at line 3120 of file NumberStringClass.cpp.
References strictComp(), TheFalseObject, TheNilObject, and TheTrueObject.
Referenced by RexxMemory::createImage().
RexxInteger * RexxNumberString::strictLessThan | ( | RexxObject * | other | ) |
Definition at line 3096 of file NumberStringClass.cpp.
References strictComp(), TheFalseObject, TheNilObject, and TheTrueObject.
Referenced by RexxMemory::createImage().
RexxInteger * RexxNumberString::strictNotEqual | ( | RexxObject * | other | ) |
Definition at line 3071 of file NumberStringClass.cpp.
References strictComp(), TheFalseObject, TheNilObject, and TheTrueObject.
Referenced by RexxMemory::createImage().
|
virtual |
Reimplemented from RexxObject.
Definition at line 222 of file NumberStringClass.cpp.
References Numerics::abs(), ch_MINUS, ch_ONE, ch_PERIOD, ch_ZERO, Numerics::DEFAULT_DIGITS, Error_Conversion_operator, Error_Overflow_expoverflow, Error_Overflow_expunderflow, RexxNumberStringBase::exp, Numerics::formatWholeNumber(), RexxNumberStringBase::length, Numerics::MAX_EXPONENT, Numerics::MIN_EXPONENT, number, RexxNumberStringBase::NumDigits, RexxNumberStringBase::NumFlags, NumFormScientific, OREF_NULL, OrefSet, RexxString::put(), RexxString::putChar(), raw_string(), reportException(), RexxString::set(), RexxInternalObject::setHasReferences(), RexxString::setNumberString(), RexxNumberStringBase::sign, and RexxNumberStringBase::stringObject.
Referenced by andOp(), comp(), compareTo(), concat(), concatBlank(), doubleValue(), getHashValue(), hasMethod(), instanceMethod(), instanceMethods(), isEqual(), isInstanceOf(), isInteger(), makeArray(), makeString(), RexxString::newString(), notOp(), operatorNot(), orOp(), primitiveMakeString(), strictComp(), unknown(), and xorOp().
|
static |
Definition at line 204 of file NumberStringMath2.cpp.
Referenced by dividePower(), and Division().
|
static |
Definition at line 970 of file NumberStringMath.cpp.
References RexxNumberStringBase::length, and number.
Referenced by addSub().
RexxObject * RexxNumberString::trunc | ( | RexxObject * | decimal_digits | ) |
Definition at line 1297 of file NumberStringClass.cpp.
References ARG_ONE, number_digits(), optionalNonNegative(), prepareNumber(), ROUND, and truncInternal().
Referenced by RexxMemory::createImage(), RexxString::trunc(), and RexxInteger::trunc().
RexxObject * RexxNumberString::truncInternal | ( | size_t | needed_digits | ) |
Definition at line 1309 of file NumberStringClass.cpp.
References RexxNumberStringBase::exp, fill_digits(), RexxString::getWritableData(), IntegerZero, RexxNumberStringBase::length, Numerics::minVal(), number, raw_string(), and RexxNumberStringBase::sign.
Referenced by ceilingInternal(), floorInternal(), roundInternal(), and trunc().
|
virtual |
Reimplemented from RexxObject.
Definition at line 1102 of file NumberStringClass.cpp.
References RexxNumberStringBase::exp, RexxNumberStringBase::length, number, reportException(), and RexxNumberStringBase::sign.
|
virtual |
Reimplemented from RexxObject.
Definition at line 2648 of file NumberStringClass.cpp.
References RexxObject::sendMessage(), and stringValue().
bool RexxNumberString::unsignedInt64Value | ( | uint64_t * | result, |
stringsize_t | numDigits | ||
) |
Definition at line 1034 of file NumberStringClass.cpp.
References checkIntegerDigits(), createUnsignedInt64Value(), RexxNumberStringBase::exp, RexxNumberStringBase::length, number, RexxNumberStringBase::sign, and UINT64_MAX.
Referenced by Numerics::objectToStringSize(), Numerics::objectToUnsignedInt64(), and Numerics::objectToUnsignedInteger().
|
virtual |
Reimplemented from RexxObject.
Definition at line 513 of file NumberStringClass.cpp.
References Numerics::DEFAULT_DIGITS, and unsignedNumberValue().
|
virtual |
Reimplemented from RexxObject.
Definition at line 595 of file NumberStringClass.cpp.
References checkIntegerDigits(), createUnsignedValue(), RexxNumberStringBase::exp, RexxNumberStringBase::length, Numerics::maxValueForDigits(), number, and RexxNumberStringBase::sign.
Referenced by unsignedNumberValue(), and RexxString::unsignedNumberValue().
RexxObject * RexxNumberString::xorOp | ( | RexxObject * | operand | ) |
Definition at line 2747 of file NumberStringClass.cpp.
References stringValue(), and RexxString::xorOp().
Referenced by RexxMemory::createImage().
Definition at line 256 of file NumberStringClass.hpp.
char RexxNumberString::number[4] |
Definition at line 271 of file NumberStringClass.hpp.
Referenced by addSub(), adjustPrecision(), ceilingInternal(), checkIntegerDigits(), comp(), d2xD2c(), Division(), floorInternal(), format(), formatInt64(), formatInternal(), formatNumber(), formatUnsignedInt64(), formatUnsignedNumber(), highBits(), int64Value(), logicalValue(), Multiply(), newInstance(), newInstanceFromDouble(), numberValue(), power(), prepareNumber(), roundInternal(), roundUp(), setZero(), stringValue(), subtractNumbers(), truncInternal(), truthValue(), unsignedInt64Value(), and unsignedNumberValue().
|
static |
Definition at line 243 of file NumberStringClass.hpp.