Home
last modified time | relevance | path

Searched refs:NumberHelper (Results 1 – 25 of 42) sorted by relevance

12

/arkcompiler/ets_runtime/ecmascript/base/tests/
Dnumber_helper_test.cpp59 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/
Dbuiltins_number_test.cpp426 … 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 …]
Dbuiltins_bigint_test.cpp545 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/
Dnumber_helper.cpp56 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 …]
Dnumber_helper.h78 class NumberHelper {
Datomic_helper.cpp71 int32_t index = base::NumberHelper::DoubleInRangeInt32(accessIndex.GetNumber()); in ValidateAtomicAccess()
Dtyped_array_helper.cpp623 if (NumberHelper::IsNaN(firstValue.GetTaggedValue())) { in SortCompare()
624 if (NumberHelper::IsNaN(secondValue.GetTaggedValue())) { in SortCompare()
631 if (NumberHelper::IsNaN(secondValue.GetTaggedValue())) { in SortCompare()
Djson_stringifier.cpp359 … 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()
Darray_helper.cpp237 tempArgs.start = base::NumberHelper::TruncateDouble(targetIndexTemp.GetNumber()); in FlattenIntoArray()
/arkcompiler/ets_runtime/ecmascript/builtins/
Dbuiltins_number.cpp38 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 …]
Dbuiltins_sharedarraybuffer.cpp188 int32_t start = base::NumberHelper::DoubleInRangeInt32(relativeStart.GetNumber()); in Slice()
206 end = base::NumberHelper::DoubleInRangeInt32(relativeEnd.GetNumber()); in Slice()
Dbuiltins_atomics.cpp23 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()
Dbuiltins_dataview.cpp55 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()
Dbuiltins_global.cpp33 using NumberHelper = base::NumberHelper; typedef
Dbuiltins_arraybuffer.cpp142 int32_t start = base::NumberHelper::DoubleInRangeInt32(relativeStart.GetNumber()); in Slice()
160 end = base::NumberHelper::DoubleInRangeInt32(relativeEnd.GetNumber()); in Slice()
/arkcompiler/ets_runtime/ecmascript/
Djs_tagged_number.h59 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()
Djs_date.cpp28 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 …]
Djs_tagged_value-inl.h152 … 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()
Djs_tagged_value.cpp115 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()
Djs_object.cpp449 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()
Dobject_operator.cpp45 …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/
Dic_binary_op.h265 … 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/
Djs_api_deque_test.cpp281 …ASSERT_TRUE(EcmaStringAccessor::StringsAreEqual(*(base::NumberHelper::NumberToString(thread, JSTag… in HWTEST_F_L0()
Djs_api_stack_test.cpp332 …ASSERT_TRUE(EcmaStringAccessor::StringsAreEqual(*(base::NumberHelper::NumberToString(thread, JSTag… in HWTEST_F_L0()
Djs_api_queue_test.cpp167 …ASSERT_TRUE(EcmaStringAccessor::StringsAreEqual(*(base::NumberHelper::NumberToString(thread, JSTag… in HWTEST_F_L0()

12