#include <Numerics.hpp>
Static Public Attributes | |
static const wholenumber_t | MAX_WHOLENUMBER = 999999999 |
static const wholenumber_t | MIN_WHOLENUMBER = -999999999 |
static const wholenumber_t | MAX_EXPONENT = 999999999 |
static const wholenumber_t | MIN_EXPONENT = -999999999 |
static const size_t | DEFAULT_DIGITS = ((size_t)9) |
static const size_t | ARGUMENT_DIGITS = ((size_t)9) |
static const size_t | SIZE_DIGITS = ((size_t)10) |
static const size_t | MAX_STRINGSIZE = MAX_WHOLENUMBER |
static const size_t | DIGITS64 = ((size_t)20) |
static const bool | FORM_SCIENTIFIC = false |
static const bool | FORM_ENGINEERING = true |
static const size_t | DEFAULT_FUZZ = ((size_t)0) |
static const bool | DEFAULT_FORM = Numerics::FORM_SCIENTIFIC |
static const wholenumber_t | validMaxWhole [] |
Static Protected Attributes | |
static NumericSettings * | settings = &Numerics::defaultSettings |
static NumericSettings | defaultSettings |
Definition at line 59 of file Numerics.hpp.
|
inlinestatic |
Definition at line 115 of file Numerics.hpp.
Referenced by RexxNumberString::Division(), RexxNumberString::format(), RexxNumberString::formatInternal(), RexxInteger::multiply(), RexxInteger::numberValue(), RexxNumberString::power(), and RexxNumberString::stringValue().
|
inlinestatic |
Definition at line 109 of file Numerics.hpp.
References NumericSettings::digits, and settings.
Referenced by number_digits().
|
inlinestatic |
Definition at line 111 of file Numerics.hpp.
References NumericSettings::form, and settings.
Referenced by number_form().
|
static |
Do portable formatting of an int64_t value into an ascii string.
integer | The value to convert. |
dest | The location to store the formatted string. |
Definition at line 739 of file Numerics.cpp.
References integer().
Referenced by RexxDateTime::formatBaseTime(), RexxDateTime::formatTimeZone(), and RexxDateTime::formatUnixTime().
|
static |
Do portable formatting of a stringsize value into an ascii string.
integer | The value to convert. |
dest | The location to store the formatted string. |
Definition at line 698 of file Numerics.cpp.
References integer().
Referenced by RexxNumberString::formatUnsignedNumber().
|
static |
Do portable formatting of a uint64_t value into an ascii string.
integer | The value to convert. |
dest | The location to store the formatted string. |
Definition at line 804 of file Numerics.cpp.
References integer().
|
static |
Do portable formatting of a wholenumber value into an ascii string.
integer | The value to convert. |
dest | The location to store the formatted string. |
Definition at line 572 of file Numerics.cpp.
References integer().
Referenced by RexxCompoundTail::buildTail(), RexxInteger::copyIntoTail(), RexxNumberString::formatInternal(), RexxInteger::primitiveMakeString(), RexxInteger::stringValue(), and RexxNumberString::stringValue().
|
inlinestatic |
Definition at line 110 of file Numerics.hpp.
References NumericSettings::fuzz, and settings.
Referenced by number_fuzz().
|
inlinestatic |
Definition at line 114 of file Numerics.hpp.
References defaultSettings.
Referenced by RexxActivationBase::getNumericSettings(), RexxNativeActivation::getNumericSettings(), and RexxActivity::RexxActivity().
|
static |
Validate that an object can be converted to an int64_t value
source | The source object. |
Definition at line 447 of file Numerics.cpp.
References DIGITS64, RexxNumberString::int64Value(), isInteger(), RexxObject::numberString(), and OREF_NULL.
Referenced by optionalBigIntegerArg(), and requiredBigIntegerArg().
|
static |
Convert a signed int64 object into the appropriate Rexx object type.
v | The value to convert. |
Definition at line 140 of file Numerics.cpp.
References MIN_WHOLENUMBER, new_integer(), and new_numberstringFromInt64().
Referenced by Int64ToObject(), RexxNativeActivation::int64Value(), RexxNativeActivation::unsignedInt64Value(), and RexxNativeActivation::valueToObject().
|
static |
Convert an signed ptr value into the appropriate Rexx object type.
v | The value to convert. |
Definition at line 866 of file Numerics.cpp.
References MAX_WHOLENUMBER, MIN_WHOLENUMBER, new_integer(), and new_numberstringFromWholenumber().
Referenced by IntptrToObject().
|
inlinestatic |
Definition at line 119 of file Numerics.hpp.
|
inlinestatic |
Definition at line 118 of file Numerics.hpp.
Referenced by RexxActivity::callFunctionExit(), RexxString::caselessCompareToRexx(), RexxString::compareToRexx(), RexxActivationStack::expandCapacity(), and MemorySegmentSet::gatherStats().
|
inlinestatic |
Definition at line 120 of file Numerics.hpp.
References ARGUMENT_DIGITS, and validMaxWhole.
Referenced by RexxNumberString::numberValue(), and RexxNumberString::unsignedNumberValue().
|
inlinestatic |
Definition at line 117 of file Numerics.hpp.
|
inlinestatic |
Definition at line 116 of file Numerics.hpp.
Referenced by StringUtil::caselessLastPos(), StringUtil::caselessPos(), RexxNumberString::ceilingInternal(), RexxArray::closeGap(), RexxNumberString::floorInternal(), RexxMutableBuffer::insert(), RexxString::insert(), StringUtil::lastPos(), RexxString::left(), RexxMutableBuffer::lower(), RexxString::lowerRexx(), RexxMutableBuffer::overlay(), StringUtil::pos(), RexxString::primitiveCaselessCompareTo(), RexxString::primitiveCompareTo(), RexxSource::resolveKeyword(), RexxString::right(), RexxMutableBuffer::setBufferLength(), StringUtil::substr(), RexxString::translate(), RexxMutableBuffer::translate(), RexxNumberString::truncInternal(), RexxMutableBuffer::upper(), RexxString::upperRexx(), and StringUtil::verify().
|
inlinestatic |
Definition at line 132 of file Numerics.hpp.
References validMaxWhole.
|
static |
Do portable formatting of a wholenumber value into numberstring format.
integer | The value to convert. |
dest | The location to store the formatted string. |
Definition at line 637 of file Numerics.cpp.
References integer().
Referenced by RexxNumberString::formatNumber().
|
static |
Convert an object into a signed int64 value.
source | The source object. |
result | The returned converted value. |
Definition at line 409 of file Numerics.cpp.
References DIGITS64, RexxNumberString::int64Value(), isInteger(), RexxObject::numberString(), and OREF_NULL.
Referenced by BUILTIN(), RexxNativeActivation::int64Value(), ObjectToInt64(), and RexxNativeActivation::objectToValue().
|
static |
Convert an object into an intptr_t values. Used for values that are numbers masking as pointers.
source | The source object. |
result | The returned value. |
Definition at line 549 of file Numerics.cpp.
References INTPTR_MAX, INTPTR_MIN, and objectToSignedInteger().
Referenced by ObjectToIntptr(), and RexxNativeActivation::objectToValue().
|
static |
Convert an object into a signed integer value.
source | The source object. |
result | The returned converted value. |
maxValue | The maximum range value for the target. |
minValue | The minimum range value for this number. |
Definition at line 269 of file Numerics.cpp.
References RexxNumberString::int64Value(), isInteger(), RexxObject::numberString(), OREF_NULL, and SIZE_DIGITS.
Referenced by ObjectToInt32(), objectToIntptr(), RexxNativeActivation::objectToValue(), and RexxNativeActivation::signedIntegerValue().
|
static |
Convert an object into an unsigned number value.
source | The source object. |
result | The returned converted value. |
maxValue | The maximum range value for the target. |
Definition at line 312 of file Numerics.cpp.
References ARGUMENT_DIGITS, isInteger(), RexxObject::numberString(), OREF_NULL, and RexxNumberString::unsignedInt64Value().
Referenced by ObjectToStringSize(), and RexxNativeActivation::objectToValue().
|
static |
Convert an object into an uintptr_t values. Used for values that are numbers masking as pointers.
source | The source object. |
result | The returned value. |
Definition at line 526 of file Numerics.cpp.
References objectToUnsignedInteger(), and UINTPTR_MAX.
Referenced by ObjectToUintptr(), and RexxNativeActivation::objectToValue().
|
static |
Convert an object into an unsigned int64 value.
source | The source object. |
result | The returned converted value. |
Definition at line 483 of file Numerics.cpp.
References DIGITS64, isInteger(), RexxObject::numberString(), OREF_NULL, and RexxNumberString::unsignedInt64Value().
Referenced by ObjectToUnsignedInt64(), RexxNativeActivation::objectToValue(), and RexxNativeActivation::unsignedInt64Value().
|
static |
Convert an object into an unsigned number value.
source | The source object. |
result | The returned converted value. |
maxValue | The maximum range value for the target. |
Definition at line 361 of file Numerics.cpp.
References isInteger(), RexxObject::numberString(), OREF_NULL, SIZE_DIGITS, and RexxNumberString::unsignedInt64Value().
Referenced by objectToUintptr(), ObjectToUnsignedInt32(), RexxNativeActivation::objectToValue(), and RexxNativeActivation::unsignedIntegerValue().
|
static |
Convert an object into a whole number value.
source | The source object. |
result | The returned converted value. |
maxValue | The maximum range value for the target. |
minValue | The minimum range value for this number. |
Definition at line 226 of file Numerics.cpp.
References ARGUMENT_DIGITS, RexxNumberString::int64Value(), isInteger(), RexxObject::numberString(), and OREF_NULL.
Referenced by RexxNativeActivation::objectToValue(), and ObjectToWholeNumber().
|
static |
Format a pointer into a string value using a consistent formatting style.
p | The pointer valut to format. |
Definition at line 888 of file Numerics.cpp.
References new_string().
Referenced by RexxPointer::stringValue(), and RexxNativeActivation::valueToObject().
|
inlinestatic |
Definition at line 112 of file Numerics.hpp.
References settings.
Referenced by ActivityManager::addWaitingActivity(), RexxActivity::requestAccess(), and RexxActivity::updateFrameMarkers().
|
inlinestatic |
Definition at line 113 of file Numerics.hpp.
References defaultSettings, and settings.
Referenced by RexxActivity::releaseAccess().
|
static |
Convert an unsigned number value into the appropriate Rexx object type.
v | The value to convert. |
Definition at line 203 of file Numerics.cpp.
References MAX_WHOLENUMBER, new_integer(), and new_numberstringFromStringsize().
Referenced by StringSizeToObject(), UnsignedInt32ToObject(), RexxNativeActivation::unsignedIntegerValue(), and RexxNativeActivation::valueToObject().
|
static |
Convert a signed int64 object into the appropriate Rexx object type.
v | The value to convert. |
Definition at line 161 of file Numerics.cpp.
References MAX_WHOLENUMBER, new_integer(), and new_numberstringFromUint64().
Referenced by UnsignedInt64ToObject(), and RexxNativeActivation::valueToObject().
|
static |
Convert an unsigned ptr value into the appropriate Rexx object type.
v | The value to convert. |
Definition at line 844 of file Numerics.cpp.
References MAX_WHOLENUMBER, new_integer(), and new_numberstringFromStringsize().
Referenced by UintptrToObject().
|
static |
Convert an signed number value into the appropriate Rexx object type.
v | The value to convert. |
Definition at line 182 of file Numerics.cpp.
References MIN_WHOLENUMBER, new_integer(), and new_numberstringFromWholenumber().
Referenced by Int32ToObject(), RexxNativeActivation::signedIntegerValue(), RexxNativeActivation::valueToObject(), and WholeNumberToObject().
|
static |
Definition at line 68 of file Numerics.hpp.
Referenced by RexxNumberString::createUnsignedValue(), lengthArgument(), maxValueForDigits(), RexxNumberString::newInstanceFromStringsize(), RexxNumberString::newInstanceFromWholenumber(), objectToStringSize(), objectToWholeNumber(), optionalIntegerArg(), positionArgument(), REQUEST_INTEGER(), and requiredIntegerArg().
|
static |
Definition at line 66 of file Numerics.hpp.
Referenced by RexxInteger::abs(), RexxSource::addText(), RexxNumberString::adjustPrecision(), RexxInteger::comp(), WithSortComparator::compare(), RexxInstructionDo::controlSetup(), RexxActivationBase::digits(), RexxNativeActivation::digits(), RexxInstructionDo::execute(), RexxInteger::integerDivide(), RexxNumberStringBase::mathRound(), RexxInteger::Max(), RexxInteger::Min(), RexxInteger::minus(), RexxInteger::multiply(), RexxNumberString::numberValue(), RexxInteger::numberValue(), NumericSettings::NumericSettings(), RexxInteger::plus(), RexxInteger::remainder(), RexxStem::sort(), RexxSource::sourceNextToken(), RexxNumberString::stringValue(), RexxSource::translate(), and RexxNumberString::unsignedNumberValue().
|
static |
Definition at line 81 of file Numerics.hpp.
Referenced by RexxActivationBase::form(), RexxNativeActivation::form(), NumericSettings::NumericSettings(), and RexxSource::translate().
|
static |
Definition at line 79 of file Numerics.hpp.
Referenced by RexxActivationBase::fuzz(), RexxNativeActivation::fuzz(), NumericSettings::NumericSettings(), and RexxSource::translate().
|
staticprotected |
Definition at line 143 of file Numerics.hpp.
Referenced by getDefaultSettings(), and setDefaultSettings().
|
static |
Definition at line 75 of file Numerics.hpp.
Referenced by RexxNumberString::createUnsignedInt64Value(), int64Object(), RexxNumberString::newInstanceFromInt64(), RexxNumberString::newInstanceFromUint64(), objectToInt64(), and objectToUnsignedInt64().
|
static |
Definition at line 77 of file Numerics.hpp.
Referenced by RexxInstructionNumeric::execute(), RexxNumberString::formatInternal(), RexxSource::optionsDirective(), and RexxNumberString::plus().
|
static |
Definition at line 76 of file Numerics.hpp.
Referenced by BUILTIN(), RexxInstructionNumeric::execute(), PackageClass::form(), RexxContext::getForm(), RexxSource::optionsDirective(), RexxNumberString::plus(), RexxNumberString::RexxNumberString(), and RexxNumberString::setNumericSettings().
|
static |
Definition at line 64 of file Numerics.hpp.
Referenced by RexxNumberString::adjustPrecision(), RexxNumberString::format(), RexxNumberStringBase::mathRound(), RexxNumberString::power(), and RexxNumberString::stringValue().
|
static |
Definition at line 72 of file Numerics.hpp.
Referenced by RexxNativeActivation::objectToValue(), and RexxNativeActivation::processArguments().
|
static |
Definition at line 62 of file Numerics.hpp.
Referenced by RexxString::caselessChangeStr(), RexxMutableBuffer::caselessChangeStr(), RexxString::changeStr(), RexxMutableBuffer::changeStr(), RexxString::delWord(), RexxMutableBuffer::delWord(), intptrToObject(), RexxInteger::numberValue(), ObjectToStringSize(), RexxNativeActivation::objectToValue(), ObjectToWholeNumber(), RexxNativeActivation::processArguments(), stringsizeToObject(), StringUtil::subWord(), StringUtil::subWords(), uint64ToObject(), uintptrToObject(), and RexxInteger::unsignedNumberValue().
|
static |
Definition at line 65 of file Numerics.hpp.
Referenced by RexxNumberString::adjustPrecision(), RexxNumberStringBase::mathRound(), and RexxNumberString::stringValue().
|
static |
Definition at line 63 of file Numerics.hpp.
Referenced by int64ToObject(), intptrToObject(), RexxInteger::minus(), RexxNativeActivation::objectToValue(), ObjectToWholeNumber(), RexxInteger::plus(), RexxNativeActivation::processArguments(), and wholenumberToObject().
|
staticprotected |
Definition at line 142 of file Numerics.hpp.
Referenced by digits(), form(), fuzz(), setCurrentSettings(), and setDefaultSettings().
|
static |
Definition at line 71 of file Numerics.hpp.
Referenced by objectToSignedInteger(), and objectToUnsignedInteger().
|
static |
Definition at line 83 of file Numerics.hpp.
Referenced by maxValueForDigits(), multiplierForExponent(), RexxInteger::numberValue(), and RexxInteger::unsignedNumberValue().