/arkcompiler/ets_runtime/ecmascript/base/tests/ |
D | number_helper_test.cpp | 59 EXPECT_FALSE(NumberHelper::IsNaN(number1)); in HWTEST_F_L0() 62 EXPECT_FALSE(NumberHelper::IsNaN(number2)); in HWTEST_F_L0() 65 EXPECT_FALSE(NumberHelper::IsNaN(number3)); in HWTEST_F_L0() 68 EXPECT_TRUE(NumberHelper::IsNaN(number4)); in HWTEST_F_L0() 71 EXPECT_TRUE(NumberHelper::IsNaN(number5)); in HWTEST_F_L0() 88 JSHandle<EcmaString> handleEcmaStr1(thread, NumberHelper::DoubleToString(thread, 37, radix)); in HWTEST_F_L0() 93 JSHandle<EcmaString> handleEcmaStr2(thread, NumberHelper::DoubleToString(thread, -37, radix)); in HWTEST_F_L0() 98 JSHandle<EcmaString> handleEcmaStr3(thread, NumberHelper::DoubleToString(thread, 37, radix)); in HWTEST_F_L0() 103 JSHandle<EcmaString> handleEcmaStr4(thread, NumberHelper::DoubleToString(thread, 37, radix)); in HWTEST_F_L0() 109 NumberHelper::DoubleToString(thread, static_cast<double>(-9223372036854775807), radix)); in HWTEST_F_L0() [all …]
|
/arkcompiler/ets_runtime/ecmascript/builtins/tests/ |
D | builtins_number_test.cpp | 426 … ASSERT_EQ(base::NumberHelper::StringToDouble(sp.begin(), sp.end(), 0, base::IGNORE_TRAILING), 0); in HWTEST_F_L0() 429 … ASSERT_EQ(base::NumberHelper::StringToDouble(sp.begin(), sp.end(), 0, base::IGNORE_TRAILING), 0); in HWTEST_F_L0() 432 … ASSERT_EQ(base::NumberHelper::StringToDouble(sp.begin(), sp.end(), 0, base::IGNORE_TRAILING), 0); in HWTEST_F_L0() 435 … ASSERT_EQ(base::NumberHelper::StringToDouble(sp.begin(), sp.end(), 0, base::IGNORE_TRAILING), 0); in HWTEST_F_L0() 438 …ASSERT_EQ(base::NumberHelper::StringToDouble(sp.begin(), sp.end(), 0, base::IGNORE_TRAILING), 0.4); in HWTEST_F_L0() 441 … ASSERT_EQ(base::NumberHelper::StringToDouble(sp.begin(), sp.end(), 0, base::IGNORE_TRAILING), 10); in HWTEST_F_L0() 444 …ASSERT_EQ(base::NumberHelper::StringToDouble(sp.begin(), sp.end(), 0, base::IGNORE_TRAILING), 1000… in HWTEST_F_L0() 447 …ASSERT_EQ(base::NumberHelper::StringToDouble(sp.begin(), sp.end(), 0, base::IGNORE_TRAILING), 1000… in HWTEST_F_L0() 452 …ASSERT_TRUE(std::isnan(base::NumberHelper::StringToDouble(sp.begin(), sp.end(), 0, base::ALLOW_HEX… in HWTEST_F_L0() 455 ASSERT_EQ(base::NumberHelper::StringToDouble(sp.begin(), sp.end(), 0, base::ALLOW_HEX), 16); in HWTEST_F_L0() [all …]
|
D | builtins_bigint_test.cpp | 545 bigint = JSHandle<JSTaggedValue>(thread, base::NumberHelper::StringToBigInt(thread, parma)); in HWTEST_F_L0() 552 bigint = JSHandle<JSTaggedValue>(thread, base::NumberHelper::StringToBigInt(thread, parma)); in HWTEST_F_L0() 560 bigint = JSHandle<JSTaggedValue>(thread, base::NumberHelper::StringToBigInt(thread, parma)); in HWTEST_F_L0() 567 bigint = JSHandle<JSTaggedValue>(thread, base::NumberHelper::StringToBigInt(thread, parma)); in HWTEST_F_L0() 575 bigint = JSHandle<JSTaggedValue>(thread, base::NumberHelper::StringToBigInt(thread, parma)); in HWTEST_F_L0() 582 bigint = JSHandle<JSTaggedValue>(thread, base::NumberHelper::StringToBigInt(thread, parma)); in HWTEST_F_L0() 590 bigint = JSHandle<JSTaggedValue>(thread, base::NumberHelper::StringToBigInt(thread, parma)); in HWTEST_F_L0() 597 bigint = JSHandle<JSTaggedValue>(thread, base::NumberHelper::StringToBigInt(thread, parma)); in HWTEST_F_L0() 604 bigint = JSHandle<JSTaggedValue>(thread, base::NumberHelper::StringToBigInt(thread, parma)); in HWTEST_F_L0() 611 bigint = JSHandle<JSTaggedValue>(thread, base::NumberHelper::StringToBigInt(thread, parma)); in HWTEST_F_L0() [all …]
|
/arkcompiler/ets_runtime/ecmascript/base/ |
D | number_helper.cpp | 56 bool NumberHelper::GotoNonspace(uint8_t **ptr, const uint8_t *end) in GotoNonspace() 85 bool NumberHelper::IsEmptyString(const uint8_t *start, const uint8_t *end) in IsEmptyString() 88 return !NumberHelper::GotoNonspace(&p, end); in IsEmptyString() 91 JSTaggedValue NumberHelper::DoubleToString(JSThread *thread, double number, int radix) in DoubleToString() 121 JSTaggedValue NumberHelper::DoubleToExponential(JSThread *thread, double number, int digit) in DoubleToExponential() 151 JSTaggedValue NumberHelper::DoubleToFixed(JSThread *thread, double number, int digit) in DoubleToFixed() 158 JSTaggedValue NumberHelper::DoubleToPrecision(JSThread *thread, double number, int digit) in DoubleToPrecision() 174 JSTaggedValue NumberHelper::StringToDoubleWithRadix(const uint8_t *start, const uint8_t *end, int r… in StringToDoubleWithRadix() 179 if (!NumberHelper::GotoNonspace(&p, end)) { in StringToDoubleWithRadix() 255 char NumberHelper::Carry(char current, int radix) in Carry() [all …]
|
D | number_helper.h | 78 class NumberHelper {
|
D | atomic_helper.cpp | 71 int32_t index = base::NumberHelper::DoubleInRangeInt32(accessIndex.GetNumber()); in ValidateAtomicAccess()
|
D | typed_array_helper.cpp | 623 if (NumberHelper::IsNaN(firstValue.GetTaggedValue())) { in SortCompare() 624 if (NumberHelper::IsNaN(secondValue.GetTaggedValue())) { in SortCompare() 631 if (NumberHelper::IsNaN(secondValue.GetTaggedValue())) { in SortCompare()
|
D | json_stringifier.cpp | 359 … result_ += ConvertToString(*base::NumberHelper::NumberToString(thread_, tagValue)); in SerializeJSONProperty() 433 str = NumberHelper::IntToString(static_cast<int32_t>(key->GetInt())); in SerializeObjectKey() 665 result_ += ConvertToString(*base::NumberHelper::NumberToString(thread_, priNum)); in SerializePrimitiveRef()
|
D | array_helper.cpp | 237 tempArgs.start = base::NumberHelper::TruncateDouble(targetIndexTemp.GetNumber()); in FlattenIntoArray()
|
/arkcompiler/ets_runtime/ecmascript/builtins/ |
D | builtins_number.cpp | 38 using NumberHelper = base::NumberHelper; typedef 87 if (NumberHelper::IsFinite(msg)) { in IsFinite() 103 if (NumberHelper::IsFinite(msg.GetTaggedValue())) { in IsInteger() 124 if (NumberHelper::IsNaN(msg)) { in IsNaN() 141 if (NumberHelper::IsFinite(msg.GetTaggedValue())) { in IsSafeInteger() 174 if (NumberHelper::IsEmptyString(str.begin(), str.end())) { in ParseFloat() 177 double result = NumberHelper::StringToDouble(str.begin(), str.end(), 0, base::IGNORE_TRAILING); in ParseFloat() 204 JSTaggedValue result = NumberHelper::StringToDoubleWithRadix(str.begin(), str.end(), radix); in ParseInt() 254 return NumberHelper::DoubleToExponential(thread, values, static_cast<int>(fraction)); in ToExponential() 296 return NumberHelper::DoubleToFixed(thread, valueNumber, static_cast<int>(digit)); in ToFixed() [all …]
|
D | builtins_sharedarraybuffer.cpp | 188 int32_t start = base::NumberHelper::DoubleInRangeInt32(relativeStart.GetNumber()); in Slice() 206 end = base::NumberHelper::DoubleInRangeInt32(relativeEnd.GetNumber()); in Slice()
|
D | builtins_atomics.cpp | 23 using NumberHelper = base::NumberHelper; typedef 204 if (NumberHelper::IsNaN(q) || (!NumberHelper::IsFinite(q) && t > 0)) { in Wait() 264 c = base::NumberHelper::TruncateDouble(countTemp.GetNumber()); in Notify()
|
D | builtins_dataview.cpp | 55 int32_t offsetInt = base::NumberHelper::DoubleInRangeInt32(offsetNumber.GetNumber()); in DataViewConstructor() 367 int32_t indexInt = base::NumberHelper::DoubleInRangeInt32(numberIndex.GetNumber()); in GetViewValue() 422 int64_t index = base::NumberHelper::DoubleInRangeInt32(numberIndex.GetNumber()); in SetViewValue()
|
D | builtins_global.cpp | 33 using NumberHelper = base::NumberHelper; typedef
|
D | builtins_arraybuffer.cpp | 142 int32_t start = base::NumberHelper::DoubleInRangeInt32(relativeStart.GetNumber()); in Slice() 160 end = base::NumberHelper::DoubleInRangeInt32(relativeEnd.GetNumber()); in Slice()
|
/arkcompiler/ets_runtime/ecmascript/ |
D | js_tagged_number.h | 59 return base::NumberHelper::DoubleToInt(GetDouble(), base::INT32_BITS); in ToInt32() 69 return base::NumberHelper::DoubleToInt(GetNumber(), base::INT16_BITS); in ToInt16() 79 return base::NumberHelper::DoubleToInt(GetNumber(), base::INT8_BITS); in ToInt8() 89 return base::NumberHelper::NumberToString(thread, *this); in ToString()
|
D | js_date.cpp | 28 using NumberHelper = base::NumberHelper; typedef 136 double hourInteger = NumberHelper::TruncateDouble(hour); in MakeTime() 137 double minInteger = NumberHelper::TruncateDouble(min); in MakeTime() 138 double secInteger = NumberHelper::TruncateDouble(sec); in MakeTime() 139 double msInteger = NumberHelper::TruncateDouble(ms); in MakeTime() 150 double yearInteger = NumberHelper::TruncateDouble(year); in MakeDay() 151 double monthInteger = NumberHelper::TruncateDouble(month); in MakeDay() 162 return static_cast<double>(days - 1) + NumberHelper::TruncateDouble(date); in MakeDay() 182 return NumberHelper::TruncateDouble(time); in TimeClip() 547 year = NumberHelper::TruncateDouble(year); in UTC() [all …]
|
D | js_tagged_value-inl.h | 152 … JSHandle<JSTaggedValue> value(thread, base::NumberHelper::StringToBigInt(thread, primValue)); in ToBigInt() 204 return JSTaggedNumber(base::NumberHelper::TruncateDouble(number.GetNumber())); in ToInteger() 211 return base::NumberHelper::DoubleToInt(number.GetNumber(), base::INT32_BITS); in ToInt32() 224 return base::NumberHelper::DoubleToInt(number.GetNumber(), base::INT16_BITS); in ToInt16() 237 return base::NumberHelper::DoubleToInt(number.GetNumber(), base::INT8_BITS); in ToInt8() 1457 … uint32_t index = static_cast<uint32_t>(base::NumberHelper::DoubleToInt(d, base::INT32_BITS)); in ToElementIndex() 1494 double d = base::NumberHelper::StringToDouble(str.begin(), str.end(), 0, in StringToDouble()
|
D | js_tagged_value.cpp | 115 int32_t intvalue = base::NumberHelper::DoubleToInt(doubleValue, base::INT32_BITS); in WithinInt32() 213 JSHandle<JSTaggedValue> yNumber(thread, base::NumberHelper::StringToBigInt(thread, y)); in Equal() 301 JSHandle<JSTaggedValue> bigY(thread, base::NumberHelper::StringToBigInt(thread, primY)); in Compare() 441 return base::NumberHelper::NumberToString(thread, tagged.GetTaggedValue()); in ToString() 988 double len = base::NumberHelper::TruncateDouble(integerIndex.GetNumber()); in ToIndex()
|
D | js_object.cpp | 449 auto key = base::NumberHelper::IntToEcmaString(thread, i); in GetAllElementKeys() 459 auto key = base::NumberHelper::IntToEcmaString(thread, i); in GetAllElementKeys() 538 keyHandle.Update(base::NumberHelper::IntToEcmaString(thread, i)); in GetEnumElementKeys() 549 keyHandle.Update(base::NumberHelper::IntToEcmaString(thread, i)); in GetEnumElementKeys() 567 auto key = base::NumberHelper::IntToEcmaString(thread, i); in GetEnumElementKeys() 577 auto key = base::NumberHelper::IntToEcmaString(thread, i); in GetEnumElementKeys() 1325 retArray->Set(thread, i, base::NumberHelper::NumberToString(thread, in GetAllPropertyKeys()
|
D | object_operator.cpp | 45 …key_ = JSHandle<JSTaggedValue>::Cast(base::NumberHelper::NumberToString(thread_, JSTaggedValue(key… in HandleKey() 73 …key_ = JSHandle<JSTaggedValue>::Cast(base::NumberHelper::NumberToString(thread_, key.GetTaggedValu… in HandleKey()
|
/arkcompiler/ets_runtime/ecmascript/ic/ |
D | ic_binary_op.h | 265 … base::NumberHelper::DoubleToInt(left.GetDouble(), base::INT32_BITS); in GetBitOPDate() 268 … base::NumberHelper::DoubleToInt(right.GetDouble(), base::INT32_BITS); in GetBitOPDate()
|
/arkcompiler/ets_runtime/ecmascript/tests/ |
D | js_api_deque_test.cpp | 281 …ASSERT_TRUE(EcmaStringAccessor::StringsAreEqual(*(base::NumberHelper::NumberToString(thread, JSTag… in HWTEST_F_L0()
|
D | js_api_stack_test.cpp | 332 …ASSERT_TRUE(EcmaStringAccessor::StringsAreEqual(*(base::NumberHelper::NumberToString(thread, JSTag… in HWTEST_F_L0()
|
D | js_api_queue_test.cpp | 167 …ASSERT_TRUE(EcmaStringAccessor::StringsAreEqual(*(base::NumberHelper::NumberToString(thread, JSTag… in HWTEST_F_L0()
|