@unicom-cloud/utils 0.1.41 → 0.1.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.virtual/_rolldown/runtime.js +1 -1
- package/.vite/manifest.json +23 -7
- package/array/index.js +1 -1
- package/assert/index.js +1 -1
- package/case-name/index.js +1 -1
- package/class-name/index.js +1 -1
- package/clipboard-copy/index.js +1 -1
- package/constant/address.js +1 -1
- package/constant/chineseCharacters.js +1 -1
- package/constant/constellations.js +1 -1
- package/constant/domain.js +1 -1
- package/constant/identity.js +1 -1
- package/constant/index.js +1 -1
- package/constant/isMobile.js +1 -1
- package/constant/keyboardCode.js +1 -1
- package/constant/licensePlate.js +1 -1
- package/constant/name.js +1 -1
- package/constant/platform.js +1 -1
- package/constant/protocol.js +1 -1
- package/constant/string.js +1 -1
- package/constant/ui.js +1 -1
- package/content-disposition/index.js +23 -23
- package/cookie/api.js +24 -23
- package/cookie/assign.js +1 -1
- package/cookie/converter.js +1 -1
- package/cookie/index.js +1 -1
- package/date/convertTime.js +10 -9
- package/date/convertToDuration.js +1 -1
- package/date/index.js +1 -1
- package/decimal/decimal.js +356 -355
- package/decimal/index.js +1 -1
- package/dom-helpers/activeElement.js +1 -1
- package/dom-helpers/addClass.js +2 -2
- package/dom-helpers/addEventListener.js +1 -1
- package/dom-helpers/animate.js +1 -1
- package/dom-helpers/animationFrame.js +1 -1
- package/dom-helpers/attribute.js +7 -6
- package/dom-helpers/camelize.js +1 -1
- package/dom-helpers/camelizeStyle.js +1 -1
- package/dom-helpers/canUseDOM.js +4 -3
- package/dom-helpers/childElements.js +1 -1
- package/dom-helpers/childNodes.js +1 -1
- package/dom-helpers/clear.js +1 -1
- package/dom-helpers/closest.js +1 -1
- package/dom-helpers/collectElements.js +1 -1
- package/dom-helpers/collectSiblings.js +1 -1
- package/dom-helpers/contains.js +1 -1
- package/dom-helpers/css.js +1 -1
- package/dom-helpers/filterEventHandler.js +1 -1
- package/dom-helpers/getComputedStyle.js +1 -1
- package/dom-helpers/getElementCoordinates.js +1 -1
- package/dom-helpers/getScrollAccessor.js +1 -1
- package/dom-helpers/hasClass.js +1 -1
- package/dom-helpers/height.js +1 -1
- package/dom-helpers/hyphenate.js +1 -1
- package/dom-helpers/hyphenateStyle.js +1 -1
- package/dom-helpers/index.js +1 -1
- package/dom-helpers/insertAfter.js +2 -2
- package/dom-helpers/isDocument.js +1 -1
- package/dom-helpers/isInput.js +1 -1
- package/dom-helpers/isTransform.js +1 -1
- package/dom-helpers/isVisible.js +1 -1
- package/dom-helpers/isWindow.js +1 -1
- package/dom-helpers/listen.js +1 -1
- package/dom-helpers/matches.js +1 -1
- package/dom-helpers/nextUntil.js +1 -1
- package/dom-helpers/offset.js +16 -15
- package/dom-helpers/offsetParent.js +2 -2
- package/dom-helpers/ownerDocument.js +2 -2
- package/dom-helpers/ownerWindow.js +2 -3
- package/dom-helpers/parents.js +1 -1
- package/dom-helpers/position.js +2 -2
- package/dom-helpers/prepend.js +1 -1
- package/dom-helpers/querySelectorAll.js +1 -1
- package/dom-helpers/reflow.js +1 -1
- package/dom-helpers/remove.js +2 -2
- package/dom-helpers/removeClass.js +2 -2
- package/dom-helpers/removeEventListener.js +1 -1
- package/dom-helpers/scrollLeft.js +1 -1
- package/dom-helpers/scrollParent.js +1 -1
- package/dom-helpers/scrollTo.js +1 -1
- package/dom-helpers/scrollTop.js +1 -1
- package/dom-helpers/scrollbarSize.js +1 -1
- package/dom-helpers/siblings.js +2 -2
- package/dom-helpers/text.js +1 -1
- package/dom-helpers/toggleClass.js +1 -1
- package/dom-helpers/transitionEnd.js +1 -1
- package/dom-helpers/triggerEvent.js +1 -1
- package/dom-helpers/types.js +1 -1
- package/dom-helpers/width.js +1 -1
- package/emitter/index.js +1 -1
- package/emoji/emoji.js +2 -2
- package/emoji/emojis.js +1 -1
- package/emoji/index.js +1 -1
- package/escape/index.js +1 -1
- package/file/fileRead.js +1 -1
- package/file/fileToDataURL.js +1 -1
- package/file/index.js +1 -1
- package/file/saveAs.js +1 -1
- package/filesize/constants.js +1 -1
- package/filesize/filesize.js +1 -1
- package/filesize/helpers.js +1 -1
- package/filesize/index.js +1 -1
- package/function/index.js +1 -1
- package/idb/async-iterators.js +1 -1
- package/idb/database-extras.js +1 -1
- package/idb/entry.js +1 -1
- package/idb/index-.js +1 -1
- package/idb/index.js +1 -1
- package/idb/util.js +1 -1
- package/idb/wrap-idb-value.js +1 -1
- package/index.js +1 -1
- package/invariant/index.js +1 -1
- package/is/index.d.ts +7 -2
- package/is/index.js +109 -94
- package/is/lib/isAscii.js +1 -1
- package/is/lib/isBase64.js +1 -1
- package/is/lib/isChinese.js +1 -1
- package/is/lib/isDataURI.js +1 -1
- package/is/lib/isEmail.js +1 -1
- package/is/lib/isFQDN.js +1 -1
- package/is/lib/isFullWidth.js +1 -1
- package/is/lib/isHSL.js +1 -1
- package/is/lib/isHalfWidth.js +1 -1
- package/is/lib/isHash.js +1 -1
- package/is/lib/isHexColor.js +1 -1
- package/is/lib/isIMEI.js +1 -1
- package/is/lib/isIP.js +1 -1
- package/is/lib/isIPRange.js +1 -1
- package/is/lib/isIdentityCard.js +1 -1
- package/is/lib/isJWT.js +1 -1
- package/is/lib/isMACAddress.js +1 -1
- package/is/lib/isMD5.js +1 -1
- package/is/lib/isMimeType.js +1 -1
- package/is/lib/isMobilePhone.js +2 -2
- package/is/lib/isPort.js +1 -1
- package/is/lib/isRgbColor.js +1 -1
- package/is/lib/isSemVer.js +1 -1
- package/is/lib/isSlug.js +1 -1
- package/is/lib/isStrongPassword.js +1 -1
- package/is/lib/isURL.js +33 -32
- package/is/lib/isUUID.js +1 -1
- package/is/lib/isVariableWidth.js +1 -1
- package/lodash/_DataView.js +1 -1
- package/lodash/_Hash.js +1 -1
- package/lodash/_LazyWrapper.js +1 -1
- package/lodash/_ListCache.js +1 -1
- package/lodash/_LodashWrapper.js +1 -1
- package/lodash/_Map.js +1 -1
- package/lodash/_MapCache.js +1 -1
- package/lodash/_Promise.js +1 -1
- package/lodash/_Set.js +1 -1
- package/lodash/_SetCache.js +1 -1
- package/lodash/_Stack.js +3 -2
- package/lodash/_Symbol.js +1 -1
- package/lodash/_Uint8Array.js +1 -1
- package/lodash/_WeakMap.js +1 -1
- package/lodash/_addMapEntry.js +1 -1
- package/lodash/_addSetEntry.js +1 -1
- package/lodash/_apply.js +1 -1
- package/lodash/_arrayAggregator.js +1 -1
- package/lodash/_arrayEach.js +1 -1
- package/lodash/_arrayEachRight.js +1 -1
- package/lodash/_arrayEvery.js +1 -1
- package/lodash/_arrayFilter.js +1 -1
- package/lodash/_arrayIncludes.js +1 -1
- package/lodash/_arrayIncludesWith.js +1 -1
- package/lodash/_arrayLikeKeys.js +1 -1
- package/lodash/_arrayMap.js +1 -1
- package/lodash/_arrayPush.js +1 -1
- package/lodash/_arrayReduce.js +1 -1
- package/lodash/_arrayReduceRight.js +1 -1
- package/lodash/_arraySample.js +1 -1
- package/lodash/_arraySampleSize.js +1 -1
- package/lodash/_arrayShuffle.js +1 -1
- package/lodash/_arraySome.js +1 -1
- package/lodash/_asciiSize.js +1 -1
- package/lodash/_asciiToArray.js +1 -1
- package/lodash/_asciiWords.js +1 -1
- package/lodash/_assignMergeValue.js +1 -1
- package/lodash/_assignValue.js +1 -1
- package/lodash/_assocIndexOf.js +1 -1
- package/lodash/_baseAggregator.js +1 -1
- package/lodash/_baseAssign.js +1 -1
- package/lodash/_baseAssignIn.js +1 -1
- package/lodash/_baseAssignValue.js +1 -1
- package/lodash/_baseAt.js +1 -1
- package/lodash/_baseClamp.js +1 -1
- package/lodash/_baseClone.js +1 -1
- package/lodash/_baseConforms.js +1 -1
- package/lodash/_baseConformsTo.js +1 -1
- package/lodash/_baseCreate.js +1 -1
- package/lodash/_baseDelay.js +1 -1
- package/lodash/_baseDifference.js +1 -1
- package/lodash/_baseEach.js +1 -1
- package/lodash/_baseEachRight.js +1 -1
- package/lodash/_baseEvery.js +1 -1
- package/lodash/_baseExtremum.js +1 -1
- package/lodash/_baseFill.js +1 -1
- package/lodash/_baseFilter.js +1 -1
- package/lodash/_baseFindIndex.js +1 -1
- package/lodash/_baseFindKey.js +1 -1
- package/lodash/_baseFlatten.js +1 -1
- package/lodash/_baseFor.js +1 -1
- package/lodash/_baseForOwn.js +1 -1
- package/lodash/_baseForOwnRight.js +1 -1
- package/lodash/_baseForRight.js +1 -1
- package/lodash/_baseFunctions.js +1 -1
- package/lodash/_baseGet.js +1 -1
- package/lodash/_baseGetAllKeys.js +1 -1
- package/lodash/_baseGetTag.js +1 -1
- package/lodash/_baseGt.js +1 -1
- package/lodash/_baseHas.js +1 -1
- package/lodash/_baseHasIn.js +1 -1
- package/lodash/_baseInRange.js +1 -1
- package/lodash/_baseIndexOf.js +1 -1
- package/lodash/_baseIndexOfWith.js +1 -1
- package/lodash/_baseIntersection.js +1 -1
- package/lodash/_baseInverter.js +1 -1
- package/lodash/_baseInvoke.js +1 -1
- package/lodash/_baseIsArguments.js +1 -1
- package/lodash/_baseIsArrayBuffer.js +1 -1
- package/lodash/_baseIsDate.js +1 -1
- package/lodash/_baseIsEqual.js +1 -1
- package/lodash/_baseIsEqualDeep.js +1 -1
- package/lodash/_baseIsMap.js +1 -1
- package/lodash/_baseIsMatch.js +1 -1
- package/lodash/_baseIsNaN.js +1 -1
- package/lodash/_baseIsNative.js +1 -1
- package/lodash/_baseIsRegExp.js +1 -1
- package/lodash/_baseIsSet.js +1 -1
- package/lodash/_baseIsTypedArray.js +1 -1
- package/lodash/_baseIteratee.js +1 -1
- package/lodash/_baseKeys.js +1 -1
- package/lodash/_baseKeysIn.js +1 -1
- package/lodash/_baseLodash.js +1 -1
- package/lodash/_baseLt.js +1 -1
- package/lodash/_baseMap.js +1 -1
- package/lodash/_baseMatches.js +1 -1
- package/lodash/_baseMatchesProperty.js +1 -1
- package/lodash/_baseMean.js +1 -1
- package/lodash/_baseMerge.js +1 -1
- package/lodash/_baseMergeDeep.js +1 -1
- package/lodash/_baseNth.js +1 -1
- package/lodash/_baseOrderBy.js +1 -1
- package/lodash/_basePick.js +1 -1
- package/lodash/_basePickBy.js +1 -1
- package/lodash/_baseProperty.js +1 -1
- package/lodash/_basePropertyDeep.js +1 -1
- package/lodash/_basePropertyOf.js +1 -1
- package/lodash/_basePullAll.js +1 -1
- package/lodash/_basePullAt.js +1 -1
- package/lodash/_baseRandom.js +1 -1
- package/lodash/_baseRange.js +1 -1
- package/lodash/_baseReduce.js +1 -1
- package/lodash/_baseRepeat.js +1 -1
- package/lodash/_baseRest.js +1 -1
- package/lodash/_baseSample.js +1 -1
- package/lodash/_baseSampleSize.js +1 -1
- package/lodash/_baseSet.js +1 -1
- package/lodash/_baseSetData.js +1 -1
- package/lodash/_baseSetToString.js +1 -1
- package/lodash/_baseShuffle.js +1 -1
- package/lodash/_baseSlice.js +1 -1
- package/lodash/_baseSome.js +1 -1
- package/lodash/_baseSortBy.js +1 -1
- package/lodash/_baseSortedIndex.js +1 -1
- package/lodash/_baseSortedIndexBy.js +1 -1
- package/lodash/_baseSortedUniq.js +1 -1
- package/lodash/_baseSum.js +1 -1
- package/lodash/_baseTimes.js +1 -1
- package/lodash/_baseToNumber.js +1 -1
- package/lodash/_baseToPairs.js +1 -1
- package/lodash/_baseToString.js +1 -1
- package/lodash/_baseTrim.js +1 -1
- package/lodash/_baseUnary.js +1 -1
- package/lodash/_baseUniq.js +1 -1
- package/lodash/_baseUnset.js +1 -1
- package/lodash/_baseUpdate.js +1 -1
- package/lodash/_baseValues.js +1 -1
- package/lodash/_baseWhile.js +1 -1
- package/lodash/_baseWrapperValue.js +1 -1
- package/lodash/_baseXor.js +1 -1
- package/lodash/_baseZipObject.js +1 -1
- package/lodash/_cacheHas.js +1 -1
- package/lodash/_castArrayLikeObject.js +1 -1
- package/lodash/_castFunction.js +1 -1
- package/lodash/_castPath.js +1 -1
- package/lodash/_castRest.js +1 -1
- package/lodash/_castSlice.js +1 -1
- package/lodash/_charsEndIndex.js +1 -1
- package/lodash/_charsStartIndex.js +1 -1
- package/lodash/_cloneArrayBuffer.js +1 -1
- package/lodash/_cloneBuffer.js +1 -1
- package/lodash/_cloneDataView.js +1 -1
- package/lodash/_cloneMap.js +1 -1
- package/lodash/_cloneRegExp.js +1 -1
- package/lodash/_cloneSet.js +1 -1
- package/lodash/_cloneSymbol.js +1 -1
- package/lodash/_cloneTypedArray.js +1 -1
- package/lodash/_compareAscending.js +1 -1
- package/lodash/_compareMultiple.js +1 -1
- package/lodash/_composeArgs.js +1 -1
- package/lodash/_composeArgsRight.js +1 -1
- package/lodash/_copyArray.js +1 -1
- package/lodash/_copyObject.js +1 -1
- package/lodash/_copySymbols.js +1 -1
- package/lodash/_copySymbolsIn.js +1 -1
- package/lodash/_coreJsData.js +1 -1
- package/lodash/_countHolders.js +1 -1
- package/lodash/_createAggregator.js +1 -1
- package/lodash/_createAssigner.js +1 -1
- package/lodash/_createBaseEach.js +1 -1
- package/lodash/_createBaseFor.js +1 -1
- package/lodash/_createBind.js +1 -1
- package/lodash/_createCaseFirst.js +1 -1
- package/lodash/_createCompounder.js +1 -1
- package/lodash/_createCtor.js +1 -1
- package/lodash/_createCurry.js +1 -1
- package/lodash/_createFind.js +1 -1
- package/lodash/_createFlow.js +1 -1
- package/lodash/_createHybrid.js +1 -1
- package/lodash/_createInverter.js +1 -1
- package/lodash/_createMathOperation.js +1 -1
- package/lodash/_createOver.js +1 -1
- package/lodash/_createPadding.js +1 -1
- package/lodash/_createPartial.js +1 -1
- package/lodash/_createRange.js +1 -1
- package/lodash/_createRecurry.js +1 -1
- package/lodash/_createRelationalOperation.js +1 -1
- package/lodash/_createRound.js +1 -1
- package/lodash/_createSet.js +1 -1
- package/lodash/_createToPairs.js +1 -1
- package/lodash/_createWrap.js +1 -1
- package/lodash/_customDefaultsAssignIn.js +1 -1
- package/lodash/_customDefaultsMerge.js +1 -1
- package/lodash/_customOmitClone.js +1 -1
- package/lodash/_deburrLetter.js +1 -1
- package/lodash/_defineProperty.js +1 -1
- package/lodash/_equalArrays.js +1 -1
- package/lodash/_equalByTag.js +1 -1
- package/lodash/_equalObjects.js +1 -1
- package/lodash/_escapeHtmlChar.js +1 -1
- package/lodash/_escapeStringChar.js +1 -1
- package/lodash/_flatRest.js +1 -1
- package/lodash/_freeGlobal.js +1 -1
- package/lodash/_getAllKeys.js +1 -1
- package/lodash/_getAllKeysIn.js +1 -1
- package/lodash/_getData.js +1 -1
- package/lodash/_getFuncName.js +1 -1
- package/lodash/_getHolder.js +1 -1
- package/lodash/_getMapData.js +1 -1
- package/lodash/_getMatchData.js +1 -1
- package/lodash/_getNative.js +1 -1
- package/lodash/_getPrototype.js +1 -1
- package/lodash/_getRawTag.js +1 -1
- package/lodash/_getSymbols.js +1 -1
- package/lodash/_getSymbolsIn.js +1 -1
- package/lodash/_getTag.js +1 -1
- package/lodash/_getValue.js +1 -1
- package/lodash/_getView.js +1 -1
- package/lodash/_getWrapDetails.js +1 -1
- package/lodash/_hasPath.js +1 -1
- package/lodash/_hasUnicode.js +1 -1
- package/lodash/_hasUnicodeWord.js +1 -1
- package/lodash/_hashClear.js +1 -1
- package/lodash/_hashDelete.js +1 -1
- package/lodash/_hashGet.js +1 -1
- package/lodash/_hashHas.js +1 -1
- package/lodash/_hashSet.js +1 -1
- package/lodash/_initCloneArray.js +1 -1
- package/lodash/_initCloneByTag.js +1 -1
- package/lodash/_initCloneObject.js +1 -1
- package/lodash/_insertWrapDetails.js +1 -1
- package/lodash/_isFlattenable.js +1 -1
- package/lodash/_isIndex.js +1 -1
- package/lodash/_isIterateeCall.js +1 -1
- package/lodash/_isKey.js +1 -1
- package/lodash/_isKeyable.js +1 -1
- package/lodash/_isLaziable.js +1 -1
- package/lodash/_isMaskable.js +1 -1
- package/lodash/_isMasked.js +1 -1
- package/lodash/_isPrototype.js +1 -1
- package/lodash/_isStrictComparable.js +1 -1
- package/lodash/_iteratorToArray.js +1 -1
- package/lodash/_lazyClone.js +1 -1
- package/lodash/_lazyReverse.js +1 -1
- package/lodash/_lazyValue.js +1 -1
- package/lodash/_listCacheClear.js +1 -1
- package/lodash/_listCacheDelete.js +1 -1
- package/lodash/_listCacheGet.js +1 -1
- package/lodash/_listCacheHas.js +1 -1
- package/lodash/_listCacheSet.js +1 -1
- package/lodash/_mapCacheClear.js +1 -1
- package/lodash/_mapCacheDelete.js +1 -1
- package/lodash/_mapCacheGet.js +1 -1
- package/lodash/_mapCacheHas.js +1 -1
- package/lodash/_mapCacheSet.js +1 -1
- package/lodash/_mapToArray.js +1 -1
- package/lodash/_matchesStrictComparable.js +1 -1
- package/lodash/_memoizeCapped.js +1 -1
- package/lodash/_mergeData.js +1 -1
- package/lodash/_metaMap.js +1 -1
- package/lodash/_nativeCreate.js +1 -1
- package/lodash/_nativeKeys.js +1 -1
- package/lodash/_nativeKeysIn.js +1 -1
- package/lodash/_nodeUtil.js +1 -1
- package/lodash/_objectToString.js +1 -1
- package/lodash/_overArg.js +1 -1
- package/lodash/_overRest.js +1 -1
- package/lodash/_parent.js +1 -1
- package/lodash/_reEscape.js +1 -1
- package/lodash/_reEvaluate.js +1 -1
- package/lodash/_reInterpolate.js +1 -1
- package/lodash/_realNames.js +1 -1
- package/lodash/_reorder.js +1 -1
- package/lodash/_replaceHolders.js +1 -1
- package/lodash/_root.js +1 -1
- package/lodash/_safeGet.js +1 -1
- package/lodash/_setCacheAdd.js +1 -1
- package/lodash/_setCacheHas.js +1 -1
- package/lodash/_setData.js +1 -1
- package/lodash/_setToArray.js +1 -1
- package/lodash/_setToPairs.js +1 -1
- package/lodash/_setToString.js +1 -1
- package/lodash/_setWrapToString.js +1 -1
- package/lodash/_shortOut.js +1 -1
- package/lodash/_shuffleSelf.js +1 -1
- package/lodash/_stackClear.js +1 -1
- package/lodash/_stackDelete.js +1 -1
- package/lodash/_stackGet.js +1 -1
- package/lodash/_stackHas.js +1 -1
- package/lodash/_stackSet.js +1 -1
- package/lodash/_strictIndexOf.js +1 -1
- package/lodash/_strictLastIndexOf.js +1 -1
- package/lodash/_stringSize.js +1 -1
- package/lodash/_stringToArray.js +1 -1
- package/lodash/_stringToPath.js +1 -1
- package/lodash/_toKey.js +1 -1
- package/lodash/_toSource.js +1 -1
- package/lodash/_trimmedEndIndex.js +1 -1
- package/lodash/_unescapeHtmlChar.js +1 -1
- package/lodash/_unicodeSize.js +1 -1
- package/lodash/_unicodeToArray.js +1 -1
- package/lodash/_unicodeWords.js +1 -1
- package/lodash/_updateWrapDetails.js +1 -1
- package/lodash/_wrapperClone.js +1 -1
- package/lodash/add.js +1 -1
- package/lodash/after.js +1 -1
- package/lodash/array.default.js +1 -1
- package/lodash/array.js +1 -1
- package/lodash/ary.js +1 -1
- package/lodash/assign.js +1 -1
- package/lodash/assignIn.js +1 -1
- package/lodash/assignInWith.js +1 -1
- package/lodash/assignWith.js +1 -1
- package/lodash/at.js +1 -1
- package/lodash/attempt.js +1 -1
- package/lodash/before.js +1 -1
- package/lodash/bind.js +1 -1
- package/lodash/bindAll.js +1 -1
- package/lodash/bindKey.js +1 -1
- package/lodash/camelCase.js +1 -1
- package/lodash/capitalize.js +1 -1
- package/lodash/castArray.js +1 -1
- package/lodash/ceil.js +1 -1
- package/lodash/chain.js +1 -1
- package/lodash/chunk.js +1 -1
- package/lodash/clamp.js +1 -1
- package/lodash/clone.js +1 -1
- package/lodash/cloneDeep.js +1 -1
- package/lodash/cloneDeepWith.js +1 -1
- package/lodash/cloneWith.js +1 -1
- package/lodash/collection.default.js +1 -1
- package/lodash/collection.js +1 -1
- package/lodash/commit.js +1 -1
- package/lodash/compact.js +1 -1
- package/lodash/concat.js +1 -1
- package/lodash/cond.js +1 -1
- package/lodash/conforms.js +1 -1
- package/lodash/conformsTo.js +1 -1
- package/lodash/constant.js +1 -1
- package/lodash/countBy.js +1 -1
- package/lodash/create.js +1 -1
- package/lodash/curry.js +1 -1
- package/lodash/curryRight.js +1 -1
- package/lodash/date.default.js +1 -1
- package/lodash/date.js +1 -1
- package/lodash/debounce.js +1 -1
- package/lodash/deburr.js +1 -1
- package/lodash/defaultTo.js +1 -1
- package/lodash/defaults.js +1 -1
- package/lodash/defaultsDeep.js +1 -1
- package/lodash/defer.js +1 -1
- package/lodash/delay.js +1 -1
- package/lodash/difference.js +1 -1
- package/lodash/differenceBy.js +1 -1
- package/lodash/differenceWith.js +1 -1
- package/lodash/divide.js +1 -1
- package/lodash/drop.js +1 -1
- package/lodash/dropRight.js +1 -1
- package/lodash/dropRightWhile.js +1 -1
- package/lodash/dropWhile.js +1 -1
- package/lodash/each.js +1 -1
- package/lodash/eachRight.js +1 -1
- package/lodash/endsWith.js +1 -1
- package/lodash/entries.js +1 -1
- package/lodash/entriesIn.js +1 -1
- package/lodash/eq.js +1 -1
- package/lodash/escape.js +1 -1
- package/lodash/escapeRegExp.js +1 -1
- package/lodash/every.js +1 -1
- package/lodash/extend.js +1 -1
- package/lodash/extendWith.js +1 -1
- package/lodash/fill.js +1 -1
- package/lodash/filter.js +1 -1
- package/lodash/find.js +1 -1
- package/lodash/findIndex.js +1 -1
- package/lodash/findKey.js +1 -1
- package/lodash/findLast.js +1 -1
- package/lodash/findLastIndex.js +1 -1
- package/lodash/findLastKey.js +1 -1
- package/lodash/first.js +1 -1
- package/lodash/flatMap.js +1 -1
- package/lodash/flatMapDeep.js +1 -1
- package/lodash/flatMapDepth.js +1 -1
- package/lodash/flatten.js +1 -1
- package/lodash/flattenDeep.js +1 -1
- package/lodash/flattenDepth.js +1 -1
- package/lodash/flip.js +1 -1
- package/lodash/floor.js +1 -1
- package/lodash/flow.js +1 -1
- package/lodash/flowRight.js +1 -1
- package/lodash/forEach.js +1 -1
- package/lodash/forEachRight.js +1 -1
- package/lodash/forIn.js +1 -1
- package/lodash/forInRight.js +1 -1
- package/lodash/forOwn.js +1 -1
- package/lodash/forOwnRight.js +1 -1
- package/lodash/fromPairs.js +1 -1
- package/lodash/function.default.js +1 -1
- package/lodash/function.js +1 -1
- package/lodash/functions.js +1 -1
- package/lodash/functionsIn.js +1 -1
- package/lodash/get.js +1 -1
- package/lodash/groupBy.js +1 -1
- package/lodash/gt.js +1 -1
- package/lodash/gte.js +1 -1
- package/lodash/has.js +1 -1
- package/lodash/hasIn.js +1 -1
- package/lodash/head.js +1 -1
- package/lodash/identity.js +1 -1
- package/lodash/inRange.js +1 -1
- package/lodash/includes.js +1 -1
- package/lodash/index.js +1 -1
- package/lodash/indexOf.js +1 -1
- package/lodash/initial.js +1 -1
- package/lodash/intersection.js +1 -1
- package/lodash/intersectionBy.js +1 -1
- package/lodash/intersectionWith.js +1 -1
- package/lodash/invert.js +1 -1
- package/lodash/invertBy.js +1 -1
- package/lodash/invoke.js +1 -1
- package/lodash/invokeMap.js +1 -1
- package/lodash/isArguments.js +1 -1
- package/lodash/isArray.js +1 -1
- package/lodash/isArrayBuffer.js +1 -1
- package/lodash/isArrayLike.js +1 -1
- package/lodash/isArrayLikeObject.js +1 -1
- package/lodash/isBoolean.js +1 -1
- package/lodash/isBuffer.js +1 -1
- package/lodash/isDate.js +1 -1
- package/lodash/isElement.js +1 -1
- package/lodash/isEmpty.js +1 -1
- package/lodash/isEqual.js +1 -1
- package/lodash/isEqualWith.js +1 -1
- package/lodash/isError.js +1 -1
- package/lodash/isFinite.js +1 -1
- package/lodash/isFunction.js +1 -1
- package/lodash/isInteger.js +1 -1
- package/lodash/isLength.js +1 -1
- package/lodash/isMap.js +1 -1
- package/lodash/isMatch.js +1 -1
- package/lodash/isMatchWith.js +1 -1
- package/lodash/isNaN.js +1 -1
- package/lodash/isNative.js +1 -1
- package/lodash/isNil.js +1 -1
- package/lodash/isNull.js +1 -1
- package/lodash/isNumber.js +1 -1
- package/lodash/isObject.js +1 -1
- package/lodash/isObjectLike.js +1 -1
- package/lodash/isPlainObject.js +1 -1
- package/lodash/isPromise.js +1 -1
- package/lodash/isRegExp.js +1 -1
- package/lodash/isSafeInteger.js +1 -1
- package/lodash/isSet.js +1 -1
- package/lodash/isString.js +1 -1
- package/lodash/isSymbol.js +1 -1
- package/lodash/isTypedArray.js +1 -1
- package/lodash/isUndefined.js +1 -1
- package/lodash/isWeakMap.js +1 -1
- package/lodash/isWeakSet.js +1 -1
- package/lodash/iteratee.js +1 -1
- package/lodash/join.js +1 -1
- package/lodash/kebabCase.js +1 -1
- package/lodash/keyBy.js +1 -1
- package/lodash/keys.js +1 -1
- package/lodash/keysIn.js +1 -1
- package/lodash/lang.default.js +1 -1
- package/lodash/lang.js +1 -1
- package/lodash/last.js +1 -1
- package/lodash/lastIndexOf.js +1 -1
- package/lodash/lodash.default.js +1 -1
- package/lodash/lodash.js +1 -1
- package/lodash/lowerCase.js +1 -1
- package/lodash/lowerFirst.js +1 -1
- package/lodash/lt.js +1 -1
- package/lodash/lte.js +1 -1
- package/lodash/map.js +1 -1
- package/lodash/mapKeys.js +1 -1
- package/lodash/mapValues.js +1 -1
- package/lodash/matches.js +1 -1
- package/lodash/matchesProperty.js +1 -1
- package/lodash/math.default.js +1 -1
- package/lodash/math.js +1 -1
- package/lodash/max.js +1 -1
- package/lodash/maxBy.js +1 -1
- package/lodash/mean.js +1 -1
- package/lodash/meanBy.js +1 -1
- package/lodash/memoize.js +1 -1
- package/lodash/merge.js +1 -1
- package/lodash/mergeWith.js +1 -1
- package/lodash/method.js +1 -1
- package/lodash/methodOf.js +1 -1
- package/lodash/min.js +1 -1
- package/lodash/minBy.js +1 -1
- package/lodash/mixin.js +1 -1
- package/lodash/multiply.js +1 -1
- package/lodash/negate.js +1 -1
- package/lodash/next.js +1 -1
- package/lodash/noop.js +1 -1
- package/lodash/now.js +1 -1
- package/lodash/nth.js +1 -1
- package/lodash/nthArg.js +1 -1
- package/lodash/number.default.js +1 -1
- package/lodash/number.js +1 -1
- package/lodash/object.default.js +1 -1
- package/lodash/object.js +1 -1
- package/lodash/omit.js +1 -1
- package/lodash/omitBy.js +1 -1
- package/lodash/once.js +1 -1
- package/lodash/orderBy.js +1 -1
- package/lodash/over.js +1 -1
- package/lodash/overArgs.js +1 -1
- package/lodash/overEvery.js +1 -1
- package/lodash/overSome.js +1 -1
- package/lodash/pad.js +1 -1
- package/lodash/padEnd.js +1 -1
- package/lodash/padStart.js +1 -1
- package/lodash/parseInt.js +1 -1
- package/lodash/partial.js +1 -1
- package/lodash/partialRight.js +1 -1
- package/lodash/partition.js +1 -1
- package/lodash/pick.js +1 -1
- package/lodash/pickBy.js +1 -1
- package/lodash/plant.js +1 -1
- package/lodash/property.js +1 -1
- package/lodash/propertyOf.js +1 -1
- package/lodash/pull.js +1 -1
- package/lodash/pullAll.js +1 -1
- package/lodash/pullAllBy.js +1 -1
- package/lodash/pullAllWith.js +1 -1
- package/lodash/pullAt.js +1 -1
- package/lodash/random.js +1 -1
- package/lodash/range.js +1 -1
- package/lodash/rangeRight.js +1 -1
- package/lodash/rearg.js +1 -1
- package/lodash/reduce.js +1 -1
- package/lodash/reduceRight.js +1 -1
- package/lodash/reject.js +1 -1
- package/lodash/remove.js +1 -1
- package/lodash/repeat.js +1 -1
- package/lodash/replace.js +1 -1
- package/lodash/rest.js +1 -1
- package/lodash/result.js +1 -1
- package/lodash/reverse.js +1 -1
- package/lodash/round.js +1 -1
- package/lodash/sample.js +1 -1
- package/lodash/sampleSize.js +1 -1
- package/lodash/seq.default.js +1 -1
- package/lodash/seq.js +1 -1
- package/lodash/set.js +1 -1
- package/lodash/setWith.js +1 -1
- package/lodash/shuffle.js +1 -1
- package/lodash/size.js +1 -1
- package/lodash/slice.js +1 -1
- package/lodash/snakeCase.js +1 -1
- package/lodash/some.js +1 -1
- package/lodash/sortBy.js +1 -1
- package/lodash/sortedIndex.js +1 -1
- package/lodash/sortedIndexBy.js +1 -1
- package/lodash/sortedIndexOf.js +1 -1
- package/lodash/sortedLastIndex.js +1 -1
- package/lodash/sortedLastIndexBy.js +1 -1
- package/lodash/sortedLastIndexOf.js +1 -1
- package/lodash/sortedUniq.js +1 -1
- package/lodash/sortedUniqBy.js +1 -1
- package/lodash/split.js +1 -1
- package/lodash/spread.js +1 -1
- package/lodash/startCase.js +1 -1
- package/lodash/startsWith.js +1 -1
- package/lodash/string.default.js +1 -1
- package/lodash/string.js +1 -1
- package/lodash/stubArray.js +1 -1
- package/lodash/stubFalse.js +1 -1
- package/lodash/stubObject.js +1 -1
- package/lodash/stubString.js +1 -1
- package/lodash/stubTrue.js +1 -1
- package/lodash/subtract.js +1 -1
- package/lodash/sum.js +1 -1
- package/lodash/sumBy.js +1 -1
- package/lodash/tail.js +1 -1
- package/lodash/take.js +1 -1
- package/lodash/takeRight.js +1 -1
- package/lodash/takeRightWhile.js +1 -1
- package/lodash/takeWhile.js +1 -1
- package/lodash/tap.js +1 -1
- package/lodash/template.js +1 -1
- package/lodash/templateSettings.js +1 -1
- package/lodash/throttle.js +1 -1
- package/lodash/thru.js +1 -1
- package/lodash/times.js +1 -1
- package/lodash/toArray.js +1 -1
- package/lodash/toFinite.js +1 -1
- package/lodash/toInteger.js +1 -1
- package/lodash/toIterator.js +1 -1
- package/lodash/toJSON.js +1 -1
- package/lodash/toLength.js +1 -1
- package/lodash/toLower.js +1 -1
- package/lodash/toNumber.js +1 -1
- package/lodash/toPairs.js +1 -1
- package/lodash/toPairsIn.js +1 -1
- package/lodash/toPath.js +1 -1
- package/lodash/toPlainObject.js +1 -1
- package/lodash/toSafeInteger.js +1 -1
- package/lodash/toString.js +1 -1
- package/lodash/toUpper.js +1 -1
- package/lodash/transform.js +1 -1
- package/lodash/trim.js +1 -1
- package/lodash/trimEnd.js +1 -1
- package/lodash/trimStart.js +1 -1
- package/lodash/truncate.js +1 -1
- package/lodash/unary.js +1 -1
- package/lodash/unescape.js +1 -1
- package/lodash/union.js +1 -1
- package/lodash/unionBy.js +1 -1
- package/lodash/unionWith.js +1 -1
- package/lodash/uniq.js +1 -1
- package/lodash/uniqBy.js +1 -1
- package/lodash/uniqWith.js +1 -1
- package/lodash/uniqueId.js +1 -1
- package/lodash/unset.js +1 -1
- package/lodash/unzip.js +1 -1
- package/lodash/unzipWith.js +1 -1
- package/lodash/update.js +1 -1
- package/lodash/updateWith.js +1 -1
- package/lodash/upperCase.js +1 -1
- package/lodash/upperFirst.js +1 -1
- package/lodash/util.default.js +1 -1
- package/lodash/util.js +1 -1
- package/lodash/value.js +1 -1
- package/lodash/valueOf.js +1 -1
- package/lodash/values.js +1 -1
- package/lodash/valuesIn.js +1 -1
- package/lodash/without.js +1 -1
- package/lodash/words.js +1 -1
- package/lodash/wrap.js +1 -1
- package/lodash/wrapperAt.js +1 -1
- package/lodash/wrapperChain.js +1 -1
- package/lodash/wrapperLodash.js +1 -1
- package/lodash/wrapperReverse.js +1 -1
- package/lodash/wrapperValue.js +1 -1
- package/lodash/xor.js +1 -1
- package/lodash/xorBy.js +1 -1
- package/lodash/xorWith.js +1 -1
- package/lodash/zip.js +1 -1
- package/lodash/zipObject.js +1 -1
- package/lodash/zipObjectDeep.js +1 -1
- package/lodash/zipWith.js +1 -1
- package/math/index.js +1 -1
- package/md5/index.js +1 -1
- package/mock/MockWebSocket.js +1 -1
- package/mock/MockXMLHttpRequest.js +1 -1
- package/mock/index.js +1 -1
- package/normalize-wheel/ExecutionEnvironment.js +9 -8
- package/normalize-wheel/UserAgent_DEPRECATED.js +2 -2
- package/normalize-wheel/index.js +1 -1
- package/normalize-wheel/isEventSupported.js +1 -1
- package/number-to-chinese/index.js +1 -1
- package/nzh/cn.js +1 -1
- package/nzh/hk.js +1 -1
- package/nzh/index.js +1 -1
- package/nzh/nzh.js +1 -1
- package/nzh/src/autoGet.js +1 -1
- package/nzh/src/index.js +2 -2
- package/nzh/src/langs/cn_b.js +1 -1
- package/nzh/src/langs/cn_s.js +1 -1
- package/nzh/src/langs/hk_b.js +1 -1
- package/nzh/src/langs/hk_s.js +1 -1
- package/nzh/src/utils.js +1 -1
- package/object/index.js +1 -1
- package/package.json +1 -1
- package/pinyin/core.js +1 -1
- package/pinyin/index.js +1 -1
- package/pinyin/simplified.js +1 -1
- package/pinyin/simplified_dict.js +1 -1
- package/pinyin/traditional.js +1 -1
- package/pinyin/traditional_dict.js +1 -1
- package/query-string/base.js +121 -121
- package/query-string/index.js +1 -1
- package/query-string/splitOnFirst.js +1 -1
- package/random/address.js +1 -1
- package/random/constellation.js +1 -1
- package/random/image.js +1 -1
- package/random/index.js +1 -1
- package/random/licensePlate.js +1 -1
- package/random/name.js +1 -1
- package/random/number.js +1 -1
- package/random/text.js +1 -1
- package/random/time.js +1 -1
- package/random/web.js +1 -1
- package/sanitize-url/index.js +1 -1
- package/screenfull/index.js +1 -1
- package/sleep/index.js +1 -1
- package/snapdom/api/preCache.js +1 -1
- package/snapdom/api/snapdom.js +1 -1
- package/snapdom/core/cache.js +1 -1
- package/snapdom/core/capture.js +1 -1
- package/snapdom/core/clone.js +1 -1
- package/snapdom/core/context.js +1 -1
- package/snapdom/core/plugins.js +1 -1
- package/snapdom/core/prepare.js +1 -1
- package/snapdom/exporters/download.js +1 -1
- package/snapdom/exporters/toBlob.js +1 -1
- package/snapdom/exporters/toCanvas.js +1 -1
- package/snapdom/exporters/toImg.js +1 -1
- package/snapdom/index.browser.js +1 -1
- package/snapdom/index.js +1 -1
- package/snapdom/modules/CSSVar.js +1 -1
- package/snapdom/modules/background.js +1 -1
- package/snapdom/modules/changeCSS.js +1 -1
- package/snapdom/modules/counter.js +1 -1
- package/snapdom/modules/fonts.js +1 -1
- package/snapdom/modules/iconFonts.js +1 -1
- package/snapdom/modules/images.js +1 -1
- package/snapdom/modules/lineClamp.js +1 -1
- package/snapdom/modules/pictureResolver.js +1 -1
- package/snapdom/modules/pseudo.js +1 -1
- package/snapdom/modules/rasterize.js +1 -1
- package/snapdom/modules/snapFetch.js +1 -1
- package/snapdom/modules/styles.js +1 -1
- package/snapdom/modules/svgDefs.js +1 -1
- package/snapdom/utils/browser.js +1 -1
- package/snapdom/utils/capture.helpers.js +1 -1
- package/snapdom/utils/clone.helpers.js +1 -1
- package/snapdom/utils/css.js +1 -1
- package/snapdom/utils/debug.js +1 -1
- package/snapdom/utils/helpers.js +1 -1
- package/snapdom/utils/image.js +1 -1
- package/snapdom/utils/index.js +1 -1
- package/snapdom/utils/prepare.helpers.js +1 -1
- package/snapdom/utils/transforms.helpers.js +1 -1
- package/string/chars.js +1 -1
- package/string/index.js +1 -1
- package/tinycolor/conversion.js +1 -1
- package/tinycolor/css-color-names.js +1 -1
- package/tinycolor/format-input.js +1 -1
- package/tinycolor/from-ratio.js +1 -1
- package/tinycolor/index.js +1 -1
- package/tinycolor/interfaces.js +1 -1
- package/tinycolor/public_api.js +1 -1
- package/tinycolor/random.js +40 -40
- package/tinycolor/readability.js +1 -1
- package/tinycolor/to-ms-filter.js +1 -1
- package/tinycolor/umd_api.js +1 -1
- package/tinycolor/utils.js +1 -1
- package/tree/index.js +1 -1
- package/tree/searchTree.js +1 -1
- package/tween/easing.js +1 -1
- package/tween/index.js +1 -1
- package/tween/tween.js +1 -1
- package/ui-color/compareColorByRange.js +1 -1
- package/ui-color/index.js +1 -1
- package/url-toolkit/index.js +1 -1
- package/validate/index.js +1 -1
- package/validate/interface.js +1 -1
- package/validate/locale/en-US.js +1 -1
- package/validate/locale/index.js +1 -1
- package/validate/locale/zh-CN.js +1 -1
- package/validate/rules/array.js +2 -2
- package/validate/rules/base.js +1 -1
- package/validate/rules/boolean.js +1 -1
- package/validate/rules/custom.js +2 -2
- package/validate/rules/number.js +2 -2
- package/validate/rules/object.js +2 -2
- package/validate/rules/string.js +2 -2
- package/validate/rules/type.js +1 -1
- package/version/index.js +1 -1
- package/xlsx/crc32.js +1 -1
- package/xlsx/index.js +1 -1
- package/xlsx/xlsx.js +1 -1
package/decimal/decimal.js
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
/* 潘启宝 2026-04-
|
|
1
|
+
/* 潘启宝 2026-04-23 09:23:17 星期四 */
|
|
2
|
+
import e from "lodash/isUndefined.js";
|
|
2
3
|
//#region utils/decimal/decimal.js
|
|
3
|
-
var
|
|
4
|
+
var t = 9e15, n = 1e9, r = "0123456789abcdef", i = "2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058", a = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789", o = {
|
|
4
5
|
precision: 20,
|
|
5
6
|
rounding: 4,
|
|
6
7
|
modulo: 1,
|
|
7
8
|
toExpNeg: -7,
|
|
8
9
|
toExpPos: 21,
|
|
9
|
-
minE: -
|
|
10
|
-
maxE:
|
|
10
|
+
minE: -t,
|
|
11
|
+
maxE: t,
|
|
11
12
|
crypto: !1
|
|
12
|
-
},
|
|
13
|
-
|
|
13
|
+
}, s, c, l, u = !0, d = "[DecimalError] ", f = `${d}Invalid argument: `, p = `${d}Precision limit exceeded`, m = `${d}crypto unavailable`, h = "[object Decimal]", g = Math.floor, _ = Math.pow, v = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i, y = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i, b = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i, x = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, S = 1e7, C = 7, w = 9007199254740991, T = i.length - 1, E = a.length - 1, D = { toStringTag: h };
|
|
14
|
+
D.absoluteValue = D.abs = function() {
|
|
14
15
|
var e = new this.constructor(this);
|
|
15
|
-
return e.s < 0 && (e.s = 1),
|
|
16
|
-
},
|
|
17
|
-
return
|
|
18
|
-
},
|
|
16
|
+
return e.s < 0 && (e.s = 1), P(e);
|
|
17
|
+
}, D.ceil = function() {
|
|
18
|
+
return P(new this.constructor(this), this.e + 1, 2);
|
|
19
|
+
}, D.clampedTo = D.clamp = function(e, t) {
|
|
19
20
|
var n, r = this, i = r.constructor;
|
|
20
21
|
if (e = new i(e), t = new i(t), !e.s || !t.s) return new i(NaN);
|
|
21
|
-
if (e.gt(t)) throw Error(
|
|
22
|
+
if (e.gt(t)) throw Error(f + t);
|
|
22
23
|
return n = r.cmp(e), n < 0 ? e : r.cmp(t) > 0 ? t : new i(r);
|
|
23
|
-
},
|
|
24
|
+
}, D.comparedTo = D.cmp = function(e) {
|
|
24
25
|
var t, n, r, i, a = this, o = a.d, s = (e = new a.constructor(e)).d, c = a.s, l = e.s;
|
|
25
26
|
if (!o || !s) return !c || !l ? NaN : c === l ? o === s ? 0 : !o ^ c < 0 ? 1 : -1 : c;
|
|
26
27
|
if (!o[0] || !s[0]) return o[0] ? c : s[0] ? -l : 0;
|
|
@@ -28,52 +29,52 @@ E.absoluteValue = E.abs = function() {
|
|
|
28
29
|
if (a.e !== e.e) return a.e > e.e ^ c < 0 ? 1 : -1;
|
|
29
30
|
for (r = o.length, i = s.length, t = 0, n = r < i ? r : i; t < n; ++t) if (o[t] !== s[t]) return o[t] > s[t] ^ c < 0 ? 1 : -1;
|
|
30
31
|
return r === i ? 0 : r > i ^ c < 0 ? 1 : -1;
|
|
31
|
-
},
|
|
32
|
+
}, D.cosine = D.cos = function() {
|
|
32
33
|
var e, t, n = this, r = n.constructor;
|
|
33
|
-
return n.d ? n.d[0] ? (e = r.precision, t = r.rounding, r.precision = e + Math.max(n.e, n.sd()) +
|
|
34
|
-
},
|
|
35
|
-
var e, t, n, r, i, a, o, s, c,
|
|
34
|
+
return n.d ? n.d[0] ? (e = r.precision, t = r.rounding, r.precision = e + Math.max(n.e, n.sd()) + C, r.rounding = 1, n = M(r, Y(r, n)), r.precision = e, r.rounding = t, P(l == 2 || l == 3 ? n.neg() : n, e, t, !0)) : new r(1) : new r(NaN);
|
|
35
|
+
}, D.cubeRoot = D.cbrt = function() {
|
|
36
|
+
var e, t, n, r, i, a, o, s, c, l, d = this, f = d.constructor;
|
|
36
37
|
if (!d.isFinite() || d.isZero()) return new f(d);
|
|
37
|
-
for (
|
|
38
|
-
if (!i && (
|
|
38
|
+
for (u = !1, a = d.s * _(d.s * d, 1 / 3), !a || Math.abs(a) == Infinity ? (n = O(d.d), e = d.e, (a = (e - n.length + 1) % 3) && (n += a == 1 || a == -2 ? "0" : "00"), a = _(n, 1 / 3), e = g((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2)), a == Infinity ? n = "5e" + e : (n = a.toExponential(), n = n.slice(0, n.indexOf("e") + 1) + e), r = new f(n), r.s = d.s) : r = new f(a.toString()), o = (e = f.precision) + 3;;) if (s = r, c = s.times(s).times(s), l = c.plus(d), r = N(l.plus(d).times(s), l.plus(c), o + 2, 1), O(s.d).slice(0, o) === (n = O(r.d)).slice(0, o)) if (n = n.slice(o - 3, o + 1), n == "9999" || !i && n == "4999") {
|
|
39
|
+
if (!i && (P(s, e + 1, 0), s.times(s).times(s).eq(d))) {
|
|
39
40
|
r = s;
|
|
40
41
|
break;
|
|
41
42
|
}
|
|
42
43
|
o += 4, i = 1;
|
|
43
44
|
} else {
|
|
44
|
-
(!+n || !+n.slice(1) && n.charAt(0) == "5") && (
|
|
45
|
+
(!+n || !+n.slice(1) && n.charAt(0) == "5") && (P(r, e + 1, 1), t = !r.times(r).times(r).eq(d));
|
|
45
46
|
break;
|
|
46
47
|
}
|
|
47
|
-
return
|
|
48
|
-
},
|
|
48
|
+
return u = !0, P(r, e, f.rounding, t);
|
|
49
|
+
}, D.decimalPlaces = D.dp = function() {
|
|
49
50
|
var e, t = this.d, n = NaN;
|
|
50
51
|
if (t) {
|
|
51
|
-
if (e = t.length - 1, n = (e -
|
|
52
|
+
if (e = t.length - 1, n = (e - g(this.e / C)) * C, e = t[e], e) for (; e % 10 == 0; e /= 10) n--;
|
|
52
53
|
n < 0 && (n = 0);
|
|
53
54
|
}
|
|
54
55
|
return n;
|
|
55
|
-
},
|
|
56
|
-
return
|
|
57
|
-
},
|
|
56
|
+
}, D.dividedBy = D.div = function(e) {
|
|
57
|
+
return N(this, new this.constructor(e));
|
|
58
|
+
}, D.dividedToIntegerBy = D.divToInt = function(e) {
|
|
58
59
|
var t = this, n = t.constructor;
|
|
59
|
-
return N(
|
|
60
|
-
},
|
|
60
|
+
return P(N(t, new n(e), 0, 1, 1), n.precision, n.rounding);
|
|
61
|
+
}, D.equals = D.eq = function(e) {
|
|
61
62
|
return this.cmp(e) === 0;
|
|
62
|
-
},
|
|
63
|
-
return
|
|
64
|
-
},
|
|
63
|
+
}, D.floor = function() {
|
|
64
|
+
return P(new this.constructor(this), this.e + 1, 3);
|
|
65
|
+
}, D.greaterThan = D.gt = function(e) {
|
|
65
66
|
return this.cmp(e) > 0;
|
|
66
|
-
},
|
|
67
|
+
}, D.greaterThanOrEqualTo = D.gte = function(e) {
|
|
67
68
|
var t = this.cmp(e);
|
|
68
69
|
return t == 1 || t === 0;
|
|
69
|
-
},
|
|
70
|
+
}, D.hyperbolicCosine = D.cosh = function() {
|
|
70
71
|
var e, t, n, r, i, a = this, o = a.constructor, s = new o(1);
|
|
71
72
|
if (!a.isFinite()) return new o(a.s ? Infinity : NaN);
|
|
72
73
|
if (a.isZero()) return s;
|
|
73
74
|
n = o.precision, r = o.rounding, o.precision = n + Math.max(a.e, a.sd()) + 4, o.rounding = 1, i = a.d.length, i < 32 ? (e = Math.ceil(i / 3), t = (1 / J(4, e)).toString()) : (e = 16, t = "2.3283064365386962890625e-10"), a = q(o, 1, a.times(t), new o(1), !0);
|
|
74
75
|
for (var c, l = e, u = new o(8); l--;) c = a.times(a), a = s.minus(c.times(u.minus(c.times(u))));
|
|
75
|
-
return
|
|
76
|
-
},
|
|
76
|
+
return P(a, o.precision = n, o.rounding = r, !0);
|
|
77
|
+
}, D.hyperbolicSine = D.sinh = function() {
|
|
77
78
|
var e, t, n, r, i = this, a = i.constructor;
|
|
78
79
|
if (!i.isFinite() || i.isZero()) return new a(i);
|
|
79
80
|
if (t = a.precision, n = a.rounding, a.precision = t + Math.max(i.e, i.sd()) + 4, a.rounding = 1, r = i.d.length, r < 3) i = q(a, 2, i, i, !0);
|
|
@@ -81,249 +82,249 @@ E.absoluteValue = E.abs = function() {
|
|
|
81
82
|
e = 1.4 * Math.sqrt(r), e = e > 16 ? 16 : e | 0, i = i.times(1 / J(5, e)), i = q(a, 2, i, i, !0);
|
|
82
83
|
for (var o, s = new a(5), c = new a(16), l = new a(20); e--;) o = i.times(i), i = i.times(s.plus(o.times(c.times(o).plus(l))));
|
|
83
84
|
}
|
|
84
|
-
return a.precision = t, a.rounding = n,
|
|
85
|
-
},
|
|
85
|
+
return a.precision = t, a.rounding = n, P(i, t, n, !0);
|
|
86
|
+
}, D.hyperbolicTangent = D.tanh = function() {
|
|
86
87
|
var e, t, n = this, r = n.constructor;
|
|
87
|
-
return n.isFinite() ? n.isZero() ? new r(n) : (e = r.precision, t = r.rounding, r.precision = e + 7, r.rounding = 1,
|
|
88
|
-
},
|
|
88
|
+
return n.isFinite() ? n.isZero() ? new r(n) : (e = r.precision, t = r.rounding, r.precision = e + 7, r.rounding = 1, N(n.sinh(), n.cosh(), r.precision = e, r.rounding = t)) : new r(n.s);
|
|
89
|
+
}, D.inverseCosine = D.acos = function() {
|
|
89
90
|
var e = this, t = e.constructor, n = e.abs().cmp(1), r = t.precision, i = t.rounding;
|
|
90
|
-
return n === -1 ? e.isZero() ?
|
|
91
|
-
},
|
|
91
|
+
return n === -1 ? e.isZero() ? R(t, r + 4, i).times(.5) : (t.precision = r + 6, t.rounding = 1, e = new t(1).minus(e).div(e.plus(1)).sqrt().atan(), t.precision = r, t.rounding = i, e.times(2)) : n === 0 ? e.isNeg() ? R(t, r, i) : new t(0) : new t(NaN);
|
|
92
|
+
}, D.inverseHyperbolicCosine = D.acosh = function() {
|
|
92
93
|
var e, t, n = this, r = n.constructor;
|
|
93
|
-
return n.lte(1) ? new r(n.eq(1) ? 0 : NaN) : n.isFinite() ? (e = r.precision, t = r.rounding, r.precision = e + Math.max(Math.abs(n.e), n.sd()) + 4, r.rounding = 1,
|
|
94
|
-
},
|
|
94
|
+
return n.lte(1) ? new r(n.eq(1) ? 0 : NaN) : n.isFinite() ? (e = r.precision, t = r.rounding, r.precision = e + Math.max(Math.abs(n.e), n.sd()) + 4, r.rounding = 1, u = !1, n = n.times(n).minus(1).sqrt().plus(n), u = !0, r.precision = e, r.rounding = t, n.ln()) : new r(n);
|
|
95
|
+
}, D.inverseHyperbolicSine = D.asinh = function() {
|
|
95
96
|
var e, t, n = this, r = n.constructor;
|
|
96
|
-
return !n.isFinite() || n.isZero() ? new r(n) : (e = r.precision, t = r.rounding, r.precision = e + 2 * Math.max(Math.abs(n.e), n.sd()) + 6, r.rounding = 1,
|
|
97
|
-
},
|
|
97
|
+
return !n.isFinite() || n.isZero() ? new r(n) : (e = r.precision, t = r.rounding, r.precision = e + 2 * Math.max(Math.abs(n.e), n.sd()) + 6, r.rounding = 1, u = !1, n = n.times(n).plus(1).sqrt().plus(n), u = !0, r.precision = e, r.rounding = t, n.ln());
|
|
98
|
+
}, D.inverseHyperbolicTangent = D.atanh = function() {
|
|
98
99
|
var e, t, n, r, i = this, a = i.constructor;
|
|
99
|
-
return i.isFinite() ? i.e >= 0 ? new a(i.abs().eq(1) ? i.s / 0 : i.isZero() ? i : NaN) : (e = a.precision, t = a.rounding, r = i.sd(), Math.max(r, e) < 2 * -i.e - 1 ?
|
|
100
|
-
},
|
|
100
|
+
return i.isFinite() ? i.e >= 0 ? new a(i.abs().eq(1) ? i.s / 0 : i.isZero() ? i : NaN) : (e = a.precision, t = a.rounding, r = i.sd(), Math.max(r, e) < 2 * -i.e - 1 ? P(new a(i), e, t, !0) : (a.precision = n = r - i.e, i = N(i.plus(1), new a(1).minus(i), n + e, 1), a.precision = e + 4, a.rounding = 1, i = i.ln(), a.precision = e, a.rounding = t, i.times(.5))) : new a(NaN);
|
|
101
|
+
}, D.inverseSine = D.asin = function() {
|
|
101
102
|
var e, t, n, r, i = this, a = i.constructor;
|
|
102
|
-
return i.isZero() ? new a(i) : (t = i.abs().cmp(1), n = a.precision, r = a.rounding, t === -1 ? (a.precision = n + 6, a.rounding = 1, i = i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(), a.precision = n, a.rounding = r, i.times(2)) : t === 0 ? (e =
|
|
103
|
-
},
|
|
104
|
-
var e, t, n, r, i, a, o, s, c,
|
|
105
|
-
if (!
|
|
106
|
-
if (!
|
|
107
|
-
if (f + 4 <=
|
|
108
|
-
} else if (
|
|
109
|
-
else if (
|
|
110
|
-
for (d.precision = s = f + 10, d.rounding = 1, n = Math.min(28, s /
|
|
111
|
-
for (
|
|
112
|
-
return n && (o = o.times(2 << n - 1)),
|
|
113
|
-
},
|
|
103
|
+
return i.isZero() ? new a(i) : (t = i.abs().cmp(1), n = a.precision, r = a.rounding, t === -1 ? (a.precision = n + 6, a.rounding = 1, i = i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(), a.precision = n, a.rounding = r, i.times(2)) : t === 0 ? (e = R(a, n + 4, r).times(.5), e.s = i.s, e) : new a(NaN));
|
|
104
|
+
}, D.inverseTangent = D.atan = function() {
|
|
105
|
+
var e, t, n, r, i, a, o, s, c, l = this, d = l.constructor, f = d.precision, p = d.rounding;
|
|
106
|
+
if (!l.isFinite()) {
|
|
107
|
+
if (!l.s) return new d(NaN);
|
|
108
|
+
if (f + 4 <= E) return o = R(d, f + 4, p).times(.5), o.s = l.s, o;
|
|
109
|
+
} else if (l.isZero()) return new d(l);
|
|
110
|
+
else if (l.abs().eq(1) && f + 4 <= E) return o = R(d, f + 4, p).times(.25), o.s = l.s, o;
|
|
111
|
+
for (d.precision = s = f + 10, d.rounding = 1, n = Math.min(28, s / C + 2 | 0), e = n; e; --e) l = l.div(l.times(l).plus(1).sqrt().plus(1));
|
|
112
|
+
for (u = !1, t = Math.ceil(s / C), r = 1, c = l.times(l), o = new d(l), i = l; e !== -1;) if (i = i.times(c), a = o.minus(i.div(r += 2)), i = i.times(c), o = a.plus(i.div(r += 2)), o.d[t] !== void 0) for (e = t; o.d[e] === a.d[e] && e--;);
|
|
113
|
+
return n && (o = o.times(2 << n - 1)), u = !0, P(o, d.precision = f, d.rounding = p, !0);
|
|
114
|
+
}, D.isFinite = function() {
|
|
114
115
|
return !!this.d;
|
|
115
|
-
},
|
|
116
|
-
return !!this.d &&
|
|
117
|
-
},
|
|
116
|
+
}, D.isInteger = D.isInt = function() {
|
|
117
|
+
return !!this.d && g(this.e / C) > this.d.length - 2;
|
|
118
|
+
}, D.isNaN = function() {
|
|
118
119
|
return !this.s;
|
|
119
|
-
},
|
|
120
|
+
}, D.isNegative = D.isNeg = function() {
|
|
120
121
|
return this.s < 0;
|
|
121
|
-
},
|
|
122
|
+
}, D.isPositive = D.isPos = function() {
|
|
122
123
|
return this.s > 0;
|
|
123
|
-
},
|
|
124
|
+
}, D.isZero = function() {
|
|
124
125
|
return !!this.d && this.d[0] === 0;
|
|
125
|
-
},
|
|
126
|
+
}, D.lessThan = D.lt = function(e) {
|
|
126
127
|
return this.cmp(e) < 0;
|
|
127
|
-
},
|
|
128
|
+
}, D.lessThanOrEqualTo = D.lte = function(e) {
|
|
128
129
|
return this.cmp(e) < 1;
|
|
129
|
-
},
|
|
130
|
-
var t, n, r, i, a, o, s, c,
|
|
130
|
+
}, D.logarithm = D.log = function(e) {
|
|
131
|
+
var t, n, r, i, a, o, s, c, l = this, d = l.constructor, f = d.precision, p = d.rounding, m = 5;
|
|
131
132
|
if (e == null) e = new d(10), t = !0;
|
|
132
133
|
else {
|
|
133
134
|
if (e = new d(e), n = e.d, e.s < 0 || !n || !n[0] || e.eq(1)) return new d(NaN);
|
|
134
135
|
t = e.eq(10);
|
|
135
136
|
}
|
|
136
|
-
if (n =
|
|
137
|
+
if (n = l.d, l.s < 0 || !n || !n[0] || l.eq(1)) return new d(n && !n[0] ? -Infinity : l.s == 1 ? n ? 0 : Infinity : NaN);
|
|
137
138
|
if (t) if (n.length > 1) a = !0;
|
|
138
139
|
else {
|
|
139
140
|
for (i = n[0]; i % 10 == 0;) i /= 10;
|
|
140
141
|
a = i !== 1;
|
|
141
142
|
}
|
|
142
|
-
if (
|
|
143
|
-
if (s += 10, o = W(
|
|
144
|
-
+
|
|
143
|
+
if (u = !1, s = f + m, o = W(l, s), r = t ? L(d, s + 10) : W(e, s), c = N(o, r, s, 1), A(c.d, i = f, p)) do
|
|
144
|
+
if (s += 10, o = W(l, s), r = t ? L(d, s + 10) : W(e, s), c = N(o, r, s, 1), !a) {
|
|
145
|
+
+O(c.d).slice(i + 1, i + 15) + 1 == 0x5af3107a4000 && (c = P(c, f + 1, 0));
|
|
145
146
|
break;
|
|
146
147
|
}
|
|
147
|
-
while (
|
|
148
|
-
return
|
|
149
|
-
},
|
|
150
|
-
var t, n, r, i, a, o, s, c,
|
|
151
|
-
if (e = new
|
|
148
|
+
while (A(c.d, i += 10, p));
|
|
149
|
+
return u = !0, P(c, f, p);
|
|
150
|
+
}, D.minus = D.sub = function(e) {
|
|
151
|
+
var t, n, r, i, a, o, s, c, l, d, f, p, m = this, h = m.constructor;
|
|
152
|
+
if (e = new h(e), !m.d || !e.d) return !m.s || !e.s ? e = new h(NaN) : m.d ? e.s = -e.s : e = new h(e.d || m.s !== e.s ? m : NaN), e;
|
|
152
153
|
if (m.s != e.s) return e.s = -e.s, m.plus(e);
|
|
153
|
-
if (
|
|
154
|
+
if (l = m.d, p = e.d, s = h.precision, c = h.rounding, !l[0] || !p[0]) {
|
|
154
155
|
if (p[0]) e.s = -e.s;
|
|
155
|
-
else if (
|
|
156
|
-
else return new
|
|
157
|
-
return
|
|
156
|
+
else if (l[0]) e = new h(m);
|
|
157
|
+
else return new h(c === 3 ? -0 : 0);
|
|
158
|
+
return u ? P(e, s, c) : e;
|
|
158
159
|
}
|
|
159
|
-
if (n =
|
|
160
|
-
for (f = a < 0, f ? (t =
|
|
160
|
+
if (n = g(e.e / C), d = g(m.e / C), l = l.slice(), a = d - n, a) {
|
|
161
|
+
for (f = a < 0, f ? (t = l, a = -a, o = p.length) : (t = p, n = d, o = l.length), r = Math.max(Math.ceil(s / C), o) + 2, a > r && (a = r, t.length = 1), t.reverse(), r = a; r--;) t.push(0);
|
|
161
162
|
t.reverse();
|
|
162
163
|
} else {
|
|
163
|
-
for (r =
|
|
164
|
-
f =
|
|
164
|
+
for (r = l.length, o = p.length, f = r < o, f && (o = r), r = 0; r < o; r++) if (l[r] != p[r]) {
|
|
165
|
+
f = l[r] < p[r];
|
|
165
166
|
break;
|
|
166
167
|
}
|
|
167
168
|
a = 0;
|
|
168
169
|
}
|
|
169
|
-
for (f && (t =
|
|
170
|
+
for (f && (t = l, l = p, p = t, e.s = -e.s), o = l.length, r = p.length - o; r > 0; --r) l[o++] = 0;
|
|
170
171
|
for (r = p.length; r > a;) {
|
|
171
|
-
if (
|
|
172
|
-
for (i = r; i &&
|
|
173
|
-
--
|
|
172
|
+
if (l[--r] < p[r]) {
|
|
173
|
+
for (i = r; i && l[--i] === 0;) l[i] = S - 1;
|
|
174
|
+
--l[i], l[r] += S;
|
|
174
175
|
}
|
|
175
|
-
|
|
176
|
+
l[r] -= p[r];
|
|
176
177
|
}
|
|
177
|
-
for (;
|
|
178
|
-
for (;
|
|
179
|
-
return
|
|
180
|
-
},
|
|
178
|
+
for (; l[--o] === 0;) l.pop();
|
|
179
|
+
for (; l[0] === 0; l.shift()) --n;
|
|
180
|
+
return l[0] ? (e.d = l, e.e = I(l, n), u ? P(e, s, c) : e) : new h(c === 3 ? -0 : 0);
|
|
181
|
+
}, D.modulo = D.mod = function(e) {
|
|
181
182
|
var t, n = this, r = n.constructor;
|
|
182
|
-
return e = new r(e), !n.d || !e.s || e.d && !e.d[0] ? new r(NaN) : !e.d || n.d && !n.d[0] ?
|
|
183
|
-
},
|
|
183
|
+
return e = new r(e), !n.d || !e.s || e.d && !e.d[0] ? new r(NaN) : !e.d || n.d && !n.d[0] ? P(new r(n), r.precision, r.rounding) : (u = !1, r.modulo == 9 ? (t = N(n, e.abs(), 0, 3, 1), t.s *= e.s) : t = N(n, e, 0, r.modulo, 1), t = t.times(e), u = !0, n.minus(t));
|
|
184
|
+
}, D.naturalExponential = D.exp = function() {
|
|
184
185
|
return U(this);
|
|
185
|
-
},
|
|
186
|
+
}, D.naturalLogarithm = D.ln = function() {
|
|
186
187
|
return W(this);
|
|
187
|
-
},
|
|
188
|
+
}, D.negated = D.neg = function() {
|
|
188
189
|
var e = new this.constructor(this);
|
|
189
|
-
return e.s = -e.s,
|
|
190
|
-
},
|
|
191
|
-
var t, n, r, i, a, o, s, c,
|
|
190
|
+
return e.s = -e.s, P(e);
|
|
191
|
+
}, D.plus = D.add = function(e) {
|
|
192
|
+
var t, n, r, i, a, o, s, c, l, d, f = this, p = f.constructor;
|
|
192
193
|
if (e = new p(e), !f.d || !e.d) return !f.s || !e.s ? e = new p(NaN) : f.d || (e = new p(e.d || f.s === e.s ? f : NaN)), e;
|
|
193
194
|
if (f.s != e.s) return e.s = -e.s, f.minus(e);
|
|
194
|
-
if (
|
|
195
|
-
if (a =
|
|
196
|
-
for (i < 0 ? (n =
|
|
195
|
+
if (l = f.d, d = e.d, s = p.precision, c = p.rounding, !l[0] || !d[0]) return d[0] || (e = new p(f)), u ? P(e, s, c) : e;
|
|
196
|
+
if (a = g(f.e / C), r = g(e.e / C), l = l.slice(), i = a - r, i) {
|
|
197
|
+
for (i < 0 ? (n = l, i = -i, o = d.length) : (n = d, r = a, o = l.length), a = Math.ceil(s / C), o = a > o ? a + 1 : o + 1, i > o && (i = o, n.length = 1), n.reverse(); i--;) n.push(0);
|
|
197
198
|
n.reverse();
|
|
198
199
|
}
|
|
199
|
-
for (o =
|
|
200
|
-
for (t && (
|
|
201
|
-
return e.d =
|
|
202
|
-
},
|
|
200
|
+
for (o = l.length, i = d.length, o - i < 0 && (i = o, n = d, d = l, l = n), t = 0; i;) t = (l[--i] = l[i] + d[i] + t) / S | 0, l[i] %= S;
|
|
201
|
+
for (t && (l.unshift(t), ++r), o = l.length; l[--o] == 0;) l.pop();
|
|
202
|
+
return e.d = l, e.e = I(l, r), u ? P(e, s, c) : e;
|
|
203
|
+
}, D.precision = D.sd = function(e) {
|
|
203
204
|
var t, n = this;
|
|
204
|
-
if (e !== void 0 && e !== !!e && e !== 1 && e !== 0) throw Error(
|
|
205
|
-
return n.d ? (t =
|
|
206
|
-
},
|
|
205
|
+
if (e !== void 0 && e !== !!e && e !== 1 && e !== 0) throw Error(f + e);
|
|
206
|
+
return n.d ? (t = z(n.d), e && n.e + 1 > t && (t = n.e + 1)) : t = NaN, t;
|
|
207
|
+
}, D.round = function() {
|
|
207
208
|
var e = this, t = e.constructor;
|
|
208
|
-
return
|
|
209
|
-
},
|
|
209
|
+
return P(new t(e), e.e + 1, t.rounding);
|
|
210
|
+
}, D.sine = D.sin = function() {
|
|
210
211
|
var e, t, n = this, r = n.constructor;
|
|
211
|
-
return n.isFinite() ? n.isZero() ? new r(n) : (e = r.precision, t = r.rounding, r.precision = e + Math.max(n.e, n.sd()) +
|
|
212
|
-
},
|
|
213
|
-
var e, t, n, r, i, a, o = this, s = o.d, c = o.e,
|
|
214
|
-
if (
|
|
215
|
-
for (
|
|
216
|
-
if (!i && (
|
|
212
|
+
return n.isFinite() ? n.isZero() ? new r(n) : (e = r.precision, t = r.rounding, r.precision = e + Math.max(n.e, n.sd()) + C, r.rounding = 1, n = ne(r, Y(r, n)), r.precision = e, r.rounding = t, P(l > 2 ? n.neg() : n, e, t, !0)) : new r(NaN);
|
|
213
|
+
}, D.squareRoot = D.sqrt = function() {
|
|
214
|
+
var e, t, n, r, i, a, o = this, s = o.d, c = o.e, l = o.s, d = o.constructor;
|
|
215
|
+
if (l !== 1 || !s || !s[0]) return new d(!l || l < 0 && (!s || s[0]) ? NaN : s ? o : Infinity);
|
|
216
|
+
for (u = !1, l = Math.sqrt(+o), l == 0 || l == Infinity ? (t = O(s), (t.length + c) % 2 == 0 && (t += "0"), l = Math.sqrt(t), c = g((c + 1) / 2) - (c < 0 || c % 2), l == Infinity ? t = "5e" + c : (t = l.toExponential(), t = t.slice(0, t.indexOf("e") + 1) + c), r = new d(t)) : r = new d(l.toString()), n = (c = d.precision) + 3;;) if (a = r, r = a.plus(N(o, a, n + 2, 1)).times(.5), O(a.d).slice(0, n) === (t = O(r.d)).slice(0, n)) if (t = t.slice(n - 3, n + 1), t == "9999" || !i && t == "4999") {
|
|
217
|
+
if (!i && (P(a, c + 1, 0), a.times(a).eq(o))) {
|
|
217
218
|
r = a;
|
|
218
219
|
break;
|
|
219
220
|
}
|
|
220
221
|
n += 4, i = 1;
|
|
221
222
|
} else {
|
|
222
|
-
(!+t || !+t.slice(1) && t.charAt(0) == "5") && (
|
|
223
|
+
(!+t || !+t.slice(1) && t.charAt(0) == "5") && (P(r, c + 1, 1), e = !r.times(r).eq(o));
|
|
223
224
|
break;
|
|
224
225
|
}
|
|
225
|
-
return
|
|
226
|
-
},
|
|
226
|
+
return u = !0, P(r, c, d.rounding, e);
|
|
227
|
+
}, D.tangent = D.tan = function() {
|
|
227
228
|
var e, t, n = this, r = n.constructor;
|
|
228
|
-
return n.isFinite() ? n.isZero() ? new r(n) : (e = r.precision, t = r.rounding, r.precision = e + 10, r.rounding = 1, n = n.sin(), n.s = 1, n =
|
|
229
|
-
},
|
|
230
|
-
var t, n, r, i, a, o, s, c,
|
|
229
|
+
return n.isFinite() ? n.isZero() ? new r(n) : (e = r.precision, t = r.rounding, r.precision = e + 10, r.rounding = 1, n = n.sin(), n.s = 1, n = N(n, new r(1).minus(n.times(n)).sqrt(), e + 10, 0), r.precision = e, r.rounding = t, P(l == 2 || l == 4 ? n.neg() : n, e, t, !0)) : new r(NaN);
|
|
230
|
+
}, D.times = D.mul = function(e) {
|
|
231
|
+
var t, n, r, i, a, o, s, c, l, d = this, f = d.constructor, p = d.d, m = (e = new f(e)).d;
|
|
231
232
|
if (e.s *= d.s, !p || !p[0] || !m || !m[0]) return new f(!e.s || p && !p[0] && !m || m && !m[0] && !p ? NaN : !p || !m ? e.s / 0 : e.s * 0);
|
|
232
|
-
for (n =
|
|
233
|
-
for (r =
|
|
234
|
-
for (t = 0, i = c + r; i > r;) s = a[i] + m[r] * p[i - r - 1] + t, a[i--] = s %
|
|
235
|
-
a[i] = (a[i] + t) %
|
|
233
|
+
for (n = g(d.e / C) + g(e.e / C), c = p.length, l = m.length, c < l && (a = p, p = m, m = a, o = c, c = l, l = o), a = [], o = c + l, r = o; r--;) a.push(0);
|
|
234
|
+
for (r = l; --r >= 0;) {
|
|
235
|
+
for (t = 0, i = c + r; i > r;) s = a[i] + m[r] * p[i - r - 1] + t, a[i--] = s % S | 0, t = s / S | 0;
|
|
236
|
+
a[i] = (a[i] + t) % S | 0;
|
|
236
237
|
}
|
|
237
238
|
for (; !a[--o];) a.pop();
|
|
238
|
-
return t ? ++n : a.shift(), e.d = a, e.e =
|
|
239
|
-
},
|
|
239
|
+
return t ? ++n : a.shift(), e.d = a, e.e = I(a, n), u ? P(e, f.precision, f.rounding) : e;
|
|
240
|
+
}, D.toBinary = function(e, t) {
|
|
240
241
|
return X(this, 2, e, t);
|
|
241
|
-
},
|
|
242
|
+
}, D.toDecimalPlaces = D.toDP = function(e, t) {
|
|
242
243
|
var r = this, i = r.constructor;
|
|
243
|
-
return r = new i(r), e === void 0 ? r : (
|
|
244
|
-
},
|
|
244
|
+
return r = new i(r), e === void 0 ? r : (k(e, 0, n), t === void 0 ? t = i.rounding : k(t, 0, 8), P(r, e + r.e + 1, t));
|
|
245
|
+
}, D.toExponential = function(e, t) {
|
|
245
246
|
var r, i = this, a = i.constructor;
|
|
246
|
-
return e === void 0 ? r =
|
|
247
|
-
},
|
|
247
|
+
return e === void 0 ? r = F(i, !0) : (k(e, 0, n), t === void 0 ? t = a.rounding : k(t, 0, 8), i = P(new a(i), e + 1, t), r = F(i, !0, e + 1)), i.isNeg() && !i.isZero() ? "-" + r : r;
|
|
248
|
+
}, D.toFixed = function(e, t) {
|
|
248
249
|
var r, i, a = this, o = a.constructor;
|
|
249
|
-
return e === void 0 ? r =
|
|
250
|
-
},
|
|
251
|
-
var t, n, r, i, a, o, s, c,
|
|
252
|
-
if (!
|
|
253
|
-
if (
|
|
250
|
+
return e === void 0 ? r = F(a) : (k(e, 0, n), t === void 0 ? t = o.rounding : k(t, 0, 8), i = P(new o(a), e + a.e + 1, t), r = F(i, !1, e + i.e + 1)), a.isNeg() && !a.isZero() ? "-" + r : r;
|
|
251
|
+
}, D.toFraction = function(e) {
|
|
252
|
+
var t, n, r, i, a, o, s, c, l, d, p, m, h = this, g = h.d, v = h.constructor;
|
|
253
|
+
if (!g) return new v(h);
|
|
254
|
+
if (l = n = new v(1), r = c = new v(0), t = new v(r), a = t.e = z(g) - h.e - 1, o = a % C, t.d[0] = _(10, o < 0 ? C + o : o), e == null) e = a > 0 ? t : l;
|
|
254
255
|
else {
|
|
255
|
-
if (s = new v(e), !s.isInt() || s.lt(
|
|
256
|
-
e = s.gt(t) ? a > 0 ? t :
|
|
256
|
+
if (s = new v(e), !s.isInt() || s.lt(l)) throw Error(f + s);
|
|
257
|
+
e = s.gt(t) ? a > 0 ? t : l : s;
|
|
257
258
|
}
|
|
258
|
-
for (
|
|
259
|
-
return i =
|
|
260
|
-
},
|
|
259
|
+
for (u = !1, s = new v(O(g)), d = v.precision, v.precision = a = g.length * C * 2; p = N(s, t, 0, 1, 1), i = n.plus(p.times(r)), i.cmp(e) != 1;) n = r, r = i, i = l, l = c.plus(p.times(i)), c = i, i = t, t = s.minus(p.times(i)), s = i;
|
|
260
|
+
return i = N(e.minus(n), r, 0, 1, 1), c = c.plus(i.times(l)), n = n.plus(i.times(r)), c.s = l.s = h.s, m = N(l, r, a, 1).minus(h).abs().cmp(N(c, n, a, 1).minus(h).abs()) < 1 ? [l, r] : [c, n], v.precision = d, u = !0, m;
|
|
261
|
+
}, D.toHexadecimal = D.toHex = function(e, t) {
|
|
261
262
|
return X(this, 16, e, t);
|
|
262
|
-
},
|
|
263
|
+
}, D.toNearest = function(e, t) {
|
|
263
264
|
var n = this, r = n.constructor;
|
|
264
265
|
if (n = new r(n), e == null) {
|
|
265
266
|
if (!n.d) return n;
|
|
266
267
|
e = new r(1), t = r.rounding;
|
|
267
268
|
} else {
|
|
268
|
-
if (e = new r(e), t === void 0 ? t = r.rounding :
|
|
269
|
+
if (e = new r(e), t === void 0 ? t = r.rounding : k(t, 0, 8), !n.d) return e.s ? n : e;
|
|
269
270
|
if (!e.d) return e.s &&= n.s, e;
|
|
270
271
|
}
|
|
271
|
-
return e.d[0] ? (
|
|
272
|
-
},
|
|
272
|
+
return e.d[0] ? (u = !1, n = N(n, e, 0, t, 1).times(e), u = !0, P(n)) : (e.s = n.s, n = e), n;
|
|
273
|
+
}, D.toNumber = function() {
|
|
273
274
|
return +this;
|
|
274
|
-
},
|
|
275
|
+
}, D.toOctal = function(e, t) {
|
|
275
276
|
return X(this, 8, e, t);
|
|
276
|
-
},
|
|
277
|
-
var t, n, r, i, a, o, s = this, c = s.constructor,
|
|
278
|
-
if (!s.d || !e.d || !s.d[0] || !e.d[0]) return new c(
|
|
277
|
+
}, D.toPower = D.pow = function(e) {
|
|
278
|
+
var t, n, r, i, a, o, s = this, c = s.constructor, l = +(e = new c(e));
|
|
279
|
+
if (!s.d || !e.d || !s.d[0] || !e.d[0]) return new c(_(+s, l));
|
|
279
280
|
if (s = new c(s), s.eq(1)) return s;
|
|
280
|
-
if (r = c.precision, a = c.rounding, e.eq(1)) return
|
|
281
|
-
if (t =
|
|
281
|
+
if (r = c.precision, a = c.rounding, e.eq(1)) return P(s, r, a);
|
|
282
|
+
if (t = g(e.e / C), t >= e.d.length - 1 && (n = l < 0 ? -l : l) <= w) return i = ee(c, s, n, r), e.s < 0 ? new c(1).div(i) : P(i, r, a);
|
|
282
283
|
if (o = s.s, o < 0) {
|
|
283
284
|
if (t < e.d.length - 1) return new c(NaN);
|
|
284
285
|
if (e.d[t] & 1 || (o = 1), s.e == 0 && s.d[0] == 1 && s.d.length == 1) return s.s = o, s;
|
|
285
286
|
}
|
|
286
|
-
return n =
|
|
287
|
-
},
|
|
287
|
+
return n = _(+s, l), t = n == 0 || !isFinite(n) ? g(l * (Math.log("0." + O(s.d)) / Math.LN10 + s.e + 1)) : new c(n + "").e, t > c.maxE + 1 || t < c.minE - 1 ? new c(t > 0 ? o / 0 : 0) : (u = !1, c.rounding = s.s = 1, n = Math.min(12, (t + "").length), i = U(e.times(W(s, r + n)), r), i.d && (i = P(i, r + 5, 1), A(i.d, r, a) && (t = r + 10, i = P(U(e.times(W(s, t + n)), t), t + 5, 1), +O(i.d).slice(r + 1, r + 15) + 1 == 0x5af3107a4000 && (i = P(i, r + 1, 0)))), i.s = o, u = !0, c.rounding = a, P(i, r, a));
|
|
288
|
+
}, D.toPrecision = function(e, t) {
|
|
288
289
|
var r, i = this, a = i.constructor;
|
|
289
|
-
return e === void 0 ? r =
|
|
290
|
-
},
|
|
290
|
+
return e === void 0 ? r = F(i, i.e <= a.toExpNeg || i.e >= a.toExpPos) : (k(e, 1, n), t === void 0 ? t = a.rounding : k(t, 0, 8), i = P(new a(i), e, t), r = F(i, e <= i.e || i.e <= a.toExpNeg, e)), i.isNeg() && !i.isZero() ? "-" + r : r;
|
|
291
|
+
}, D.toSignificantDigits = D.toSD = function(e, t) {
|
|
291
292
|
var r = this, i = r.constructor;
|
|
292
|
-
return e === void 0 ? (e = i.precision,
|
|
293
|
-
},
|
|
294
|
-
var e = this, t = e.constructor, n =
|
|
293
|
+
return e === void 0 ? (e = i.precision, t = i.rounding) : (k(e, 1, n), t === void 0 ? t = i.rounding : k(t, 0, 8)), P(new i(r), e, t);
|
|
294
|
+
}, D.toString = function() {
|
|
295
|
+
var e = this, t = e.constructor, n = F(e, e.e <= t.toExpNeg || e.e >= t.toExpPos);
|
|
295
296
|
return e.isNeg() && !e.isZero() ? "-" + n : n;
|
|
296
|
-
},
|
|
297
|
-
return
|
|
298
|
-
},
|
|
299
|
-
var e = this, t = e.constructor, n =
|
|
297
|
+
}, D.truncated = D.trunc = function() {
|
|
298
|
+
return P(new this.constructor(this), this.e + 1, 1);
|
|
299
|
+
}, D.valueOf = D.toJSON = function() {
|
|
300
|
+
var e = this, t = e.constructor, n = F(e, e.e <= t.toExpNeg || e.e >= t.toExpPos);
|
|
300
301
|
return e.isNeg() ? "-" + n : n;
|
|
301
302
|
};
|
|
302
|
-
function
|
|
303
|
+
function O(e) {
|
|
303
304
|
var t, n, r, i = e.length - 1, a = "", o = e[0];
|
|
304
305
|
if (i > 0) {
|
|
305
|
-
for (a += o, t = 1; t < i; t++) r = e[t] + "", n =
|
|
306
|
-
o = e[t], r = o + "", n =
|
|
306
|
+
for (a += o, t = 1; t < i; t++) r = e[t] + "", n = C - r.length, n && (a += B(n)), a += r;
|
|
307
|
+
o = e[t], r = o + "", n = C - r.length, n && (a += B(n));
|
|
307
308
|
} else if (o === 0) return "0";
|
|
308
309
|
for (; o % 10 == 0;) o /= 10;
|
|
309
310
|
return a + o;
|
|
310
311
|
}
|
|
311
|
-
function
|
|
312
|
-
if (e !== ~~e || e < t || e > n) throw Error(
|
|
312
|
+
function k(e, t, n) {
|
|
313
|
+
if (e !== ~~e || e < t || e > n) throw Error(f + e);
|
|
313
314
|
}
|
|
314
|
-
function
|
|
315
|
+
function A(e, t, n, r) {
|
|
315
316
|
var i, a, o, s;
|
|
316
317
|
for (a = e[0]; a >= 10; a /= 10) --t;
|
|
317
|
-
return --t < 0 ? (t +=
|
|
318
|
+
return --t < 0 ? (t += C, i = 0) : (i = Math.ceil((t + 1) / C), t %= C), a = _(10, C - t), s = e[i] % a | 0, r == null ? t < 3 ? (t == 0 ? s = s / 100 | 0 : t == 1 && (s = s / 10 | 0), o = n < 4 && s == 99999 || n > 3 && s == 49999 || s == 5e4 || s == 0) : o = (n < 4 && s + 1 == a || n > 3 && s + 1 == a / 2) && (e[i + 1] / a / 100 | 0) == _(10, t - 2) - 1 || (s == a / 2 || s == 0) && (e[i + 1] / a / 100 | 0) == 0 : t < 4 ? (t == 0 ? s = s / 1e3 | 0 : t == 1 ? s = s / 100 | 0 : t == 2 && (s = s / 10 | 0), o = (r || n < 4) && s == 9999 || !r && n > 3 && s == 4999) : o = ((r || n < 4) && s + 1 == a || !r && n > 3 && s + 1 == a / 2) && (e[i + 1] / a / 1e3 | 0) == _(10, t - 3) - 1, o;
|
|
318
319
|
}
|
|
319
|
-
function
|
|
320
|
+
function j(e, t, n) {
|
|
320
321
|
for (var i, a = [0], o, s = 0, c = e.length; s < c;) {
|
|
321
322
|
for (o = a.length; o--;) a[o] *= t;
|
|
322
|
-
for (a[0] +=
|
|
323
|
+
for (a[0] += r.indexOf(e.charAt(s++)), i = 0; i < a.length; i++) a[i] > n - 1 && (a[i + 1] === void 0 && (a[i + 1] = 0), a[i + 1] += a[i] / n | 0, a[i] %= n);
|
|
323
324
|
}
|
|
324
325
|
return a.reverse();
|
|
325
326
|
}
|
|
326
|
-
function
|
|
327
|
+
function M(e, t) {
|
|
327
328
|
var n, r, i;
|
|
328
329
|
if (t.isZero()) return t;
|
|
329
330
|
r = t.d.length, r < 32 ? (n = Math.ceil(r / 3), i = (1 / J(4, n)).toString()) : (n = 16, i = "2.3283064365386962890625e-10"), e.precision += n, t = q(e, 1, t.times(i), new e(1));
|
|
@@ -333,7 +334,7 @@ function j(e, t) {
|
|
|
333
334
|
}
|
|
334
335
|
return e.precision -= n, t;
|
|
335
336
|
}
|
|
336
|
-
var
|
|
337
|
+
var N = (function() {
|
|
337
338
|
function e(e, t, n) {
|
|
338
339
|
var r, i = 0, a = e.length;
|
|
339
340
|
for (e = e.slice(); a--;) r = e[a] * t + i, e[a] = r % n | 0, i = r / n | 0;
|
|
@@ -352,101 +353,101 @@ var M = (function() {
|
|
|
352
353
|
for (var i = 0; n--;) e[n] -= i, i = +(e[n] < t[n]), e[n] = i * r + e[n] - t[n];
|
|
353
354
|
for (; !e[0] && e.length > 1;) e.shift();
|
|
354
355
|
}
|
|
355
|
-
return function(r, i, a, o,
|
|
356
|
-
var u, d, f, p, m,
|
|
357
|
-
if (!I || !I[0] || !L || !L[0]) return new
|
|
358
|
-
for (l ? (m = 1, d = r.e - i.e) : (l =
|
|
359
|
-
if (L[f] > (I[f] || 0) && d--, a == null ? (E = a =
|
|
356
|
+
return function(r, i, a, o, s, l) {
|
|
357
|
+
var u, d, f, p, m, h, _, v, y, b, x, w, T, E, D, O, k, A, j, M, N = r.constructor, F = r.s == i.s ? 1 : -1, I = r.d, L = i.d;
|
|
358
|
+
if (!I || !I[0] || !L || !L[0]) return new N(!r.s || !i.s || (I ? L && I[0] == L[0] : !L) ? NaN : I && I[0] == 0 || !L ? F * 0 : F / 0);
|
|
359
|
+
for (l ? (m = 1, d = r.e - i.e) : (l = S, m = C, d = g(r.e / m) - g(i.e / m)), j = L.length, k = I.length, y = new N(F), b = y.d = [], f = 0; L[f] == (I[f] || 0); f++);
|
|
360
|
+
if (L[f] > (I[f] || 0) && d--, a == null ? (E = a = N.precision, o = N.rounding) : E = s ? a + (r.e - i.e) + 1 : a, E < 0) b.push(1), h = !0;
|
|
360
361
|
else {
|
|
361
362
|
if (E = E / m + 2 | 0, f = 0, j == 1) {
|
|
362
363
|
for (p = 0, L = L[0], E++; (f < k || p) && E--; f++) D = p * l + (I[f] || 0), b[f] = D / L | 0, p = D % L | 0;
|
|
363
|
-
|
|
364
|
+
h = p || f < k;
|
|
364
365
|
} else {
|
|
365
|
-
for (p = l / (L[0] + 1) | 0, p > 1 && (L = e(L, p, l), I = e(I, p, l), j = L.length, k = I.length), O = j,
|
|
366
|
+
for (p = l / (L[0] + 1) | 0, p > 1 && (L = e(L, p, l), I = e(I, p, l), j = L.length, k = I.length), O = j, x = I.slice(0, j), w = x.length; w < j;) x[w++] = 0;
|
|
366
367
|
M = L.slice(), M.unshift(0), A = L[0], L[1] >= l / 2 && ++A;
|
|
367
368
|
do
|
|
368
|
-
p = 0, u = t(L,
|
|
369
|
-
while ((O++ < k ||
|
|
370
|
-
|
|
369
|
+
p = 0, u = t(L, x, j, w), u < 0 ? (T = x[0], j != w && (T = T * l + (x[1] || 0)), p = T / A | 0, p > 1 ? (p >= l && (p = l - 1), _ = e(L, p, l), v = _.length, w = x.length, u = t(_, x, v, w), u == 1 && (p--, n(_, j < v ? M : L, v, l))) : (p == 0 && (u = p = 1), _ = L.slice()), v = _.length, v < w && _.unshift(0), n(x, _, w, l), u == -1 && (w = x.length, u = t(L, x, j, w), u < 1 && (p++, n(x, j < w ? M : L, w, l))), w = x.length) : u === 0 && (p++, x = [0]), b[f++] = p, u && x[0] ? x[w++] = I[O] || 0 : (x = [I[O]], w = 1);
|
|
370
|
+
while ((O++ < k || x[0] !== void 0) && E--);
|
|
371
|
+
h = x[0] !== void 0;
|
|
371
372
|
}
|
|
372
373
|
b[0] || b.shift();
|
|
373
374
|
}
|
|
374
|
-
if (m == 1) y.e = d,
|
|
375
|
+
if (m == 1) y.e = d, c = h;
|
|
375
376
|
else {
|
|
376
377
|
for (f = 1, p = b[0]; p >= 10; p /= 10) f++;
|
|
377
|
-
y.e = f + d * m - 1,
|
|
378
|
+
y.e = f + d * m - 1, P(y, s ? a + y.e + 1 : a, o, h);
|
|
378
379
|
}
|
|
379
380
|
return y;
|
|
380
381
|
};
|
|
381
382
|
})();
|
|
382
|
-
function
|
|
383
|
-
var i, a, o, s, c,
|
|
383
|
+
function P(e, t, n, r) {
|
|
384
|
+
var i, a, o, s, c, l, d, f, p, m = e.constructor;
|
|
384
385
|
out: if (t != null) {
|
|
385
386
|
if (f = e.d, !f) return e;
|
|
386
387
|
for (i = 1, s = f[0]; s >= 10; s /= 10) i++;
|
|
387
|
-
if (a = t - i, a < 0) a +=
|
|
388
|
-
else if (p = Math.ceil((a + 1) /
|
|
388
|
+
if (a = t - i, a < 0) a += C, o = t, d = f[p = 0], c = d / _(10, i - o - 1) % 10 | 0;
|
|
389
|
+
else if (p = Math.ceil((a + 1) / C), s = f.length, p >= s) if (r) {
|
|
389
390
|
for (; s++ <= p;) f.push(0);
|
|
390
|
-
d = c = 0, i = 1, a %=
|
|
391
|
+
d = c = 0, i = 1, a %= C, o = a - C + 1;
|
|
391
392
|
} else break out;
|
|
392
393
|
else {
|
|
393
394
|
for (d = s = f[p], i = 1; s >= 10; s /= 10) i++;
|
|
394
|
-
a %=
|
|
395
|
+
a %= C, o = a - C + i, c = o < 0 ? 0 : d / _(10, i - o - 1) % 10 | 0;
|
|
395
396
|
}
|
|
396
|
-
if (r = r || t < 0 || f[p + 1] !== void 0 || (o < 0 ? d : d %
|
|
397
|
-
if (a == 0 ? (f.length = p, s = 1, p--) : (f.length = p + 1, s =
|
|
397
|
+
if (r = r || t < 0 || f[p + 1] !== void 0 || (o < 0 ? d : d % _(10, i - o - 1)), l = n < 4 ? (c || r) && (n == 0 || n == (e.s < 0 ? 3 : 2)) : c > 5 || c == 5 && (n == 4 || r || n == 6 && (a > 0 ? o > 0 ? d / _(10, i - o) : 0 : f[p - 1]) % 10 & 1 || n == (e.s < 0 ? 8 : 7)), t < 1 || !f[0]) return f.length = 0, l ? (t -= e.e + 1, f[0] = _(10, (C - t % C) % C), e.e = -t || 0) : f[0] = e.e = 0, e;
|
|
398
|
+
if (a == 0 ? (f.length = p, s = 1, p--) : (f.length = p + 1, s = _(10, C - a), f[p] = o > 0 ? (d / _(10, i - o) % _(10, o) | 0) * s : 0), l) for (;;) if (p == 0) {
|
|
398
399
|
for (a = 1, o = f[0]; o >= 10; o /= 10) a++;
|
|
399
400
|
for (o = f[0] += s, s = 1; o >= 10; o /= 10) s++;
|
|
400
|
-
a != s && (e.e++, f[0] ==
|
|
401
|
+
a != s && (e.e++, f[0] == S && (f[0] = 1));
|
|
401
402
|
break;
|
|
402
403
|
} else {
|
|
403
|
-
if (f[p] += s, f[p] !=
|
|
404
|
+
if (f[p] += s, f[p] != S) break;
|
|
404
405
|
f[p--] = 0, s = 1;
|
|
405
406
|
}
|
|
406
407
|
for (a = f.length; f[--a] === 0;) f.pop();
|
|
407
408
|
}
|
|
408
|
-
return
|
|
409
|
+
return u && (e.e > m.maxE ? (e.d = null, e.e = NaN) : e.e < m.minE && (e.e = 0, e.d = [0])), e;
|
|
409
410
|
}
|
|
410
|
-
function
|
|
411
|
+
function F(e, t, n) {
|
|
411
412
|
if (!e.isFinite()) return G(e);
|
|
412
|
-
var r, i = e.e, a =
|
|
413
|
-
return t ? (n && (r = n - o) > 0 ? a = a.charAt(0) + "." + a.slice(1) +
|
|
413
|
+
var r, i = e.e, a = O(e.d), o = a.length;
|
|
414
|
+
return t ? (n && (r = n - o) > 0 ? a = a.charAt(0) + "." + a.slice(1) + B(r) : o > 1 && (a = a.charAt(0) + "." + a.slice(1)), a = a + (e.e < 0 ? "e" : "e+") + e.e) : i < 0 ? (a = "0." + B(-i - 1) + a, n && (r = n - o) > 0 && (a += B(r))) : i >= o ? (a += B(i + 1 - o), n && (r = n - i - 1) > 0 && (a = a + "." + B(r))) : ((r = i + 1) < o && (a = a.slice(0, r) + "." + a.slice(r)), n && (r = n - o) > 0 && (i + 1 === o && (a += "."), a += B(r))), a;
|
|
414
415
|
}
|
|
415
|
-
function
|
|
416
|
+
function I(e, t) {
|
|
416
417
|
var n = e[0];
|
|
417
|
-
for (t *=
|
|
418
|
+
for (t *= C; n >= 10; n /= 10) t++;
|
|
418
419
|
return t;
|
|
419
420
|
}
|
|
420
|
-
function I(e, t, n) {
|
|
421
|
-
if (t > w) throw l = !0, n && (e.precision = n), Error(f);
|
|
422
|
-
return N(new e(r), t, 1, !0);
|
|
423
|
-
}
|
|
424
421
|
function L(e, t, n) {
|
|
425
|
-
if (t > T) throw Error(
|
|
426
|
-
return
|
|
422
|
+
if (t > T) throw u = !0, n && (e.precision = n), Error(p);
|
|
423
|
+
return P(new e(i), t, 1, !0);
|
|
424
|
+
}
|
|
425
|
+
function R(e, t, n) {
|
|
426
|
+
if (t > E) throw Error(p);
|
|
427
|
+
return P(new e(a), t, n, !0);
|
|
427
428
|
}
|
|
428
|
-
function
|
|
429
|
-
var t = e.length - 1, n = t *
|
|
429
|
+
function z(e) {
|
|
430
|
+
var t = e.length - 1, n = t * C + 1;
|
|
430
431
|
if (t = e[t], t) {
|
|
431
432
|
for (; t % 10 == 0; t /= 10) n--;
|
|
432
433
|
for (t = e[0]; t >= 10; t /= 10) n++;
|
|
433
434
|
}
|
|
434
435
|
return n;
|
|
435
436
|
}
|
|
436
|
-
function
|
|
437
|
+
function B(e) {
|
|
437
438
|
for (var t = ""; e--;) t += "0";
|
|
438
439
|
return t;
|
|
439
440
|
}
|
|
440
|
-
function
|
|
441
|
-
var i, a = new e(1), o = Math.ceil(r /
|
|
442
|
-
for (
|
|
443
|
-
if (n % 2 && (a = a.times(t), Z(a.d, o) && (i = !0)), n =
|
|
441
|
+
function ee(e, t, n, r) {
|
|
442
|
+
var i, a = new e(1), o = Math.ceil(r / C + 4);
|
|
443
|
+
for (u = !1;;) {
|
|
444
|
+
if (n % 2 && (a = a.times(t), Z(a.d, o) && (i = !0)), n = g(n / 2), n === 0) {
|
|
444
445
|
n = a.d.length - 1, i && a.d[n] === 0 && ++a.d[n];
|
|
445
446
|
break;
|
|
446
447
|
}
|
|
447
448
|
t = t.times(t), Z(t.d, o);
|
|
448
449
|
}
|
|
449
|
-
return
|
|
450
|
+
return u = !0, a;
|
|
450
451
|
}
|
|
451
452
|
function V(e) {
|
|
452
453
|
return e.d[e.d.length - 1] & 1;
|
|
@@ -462,31 +463,31 @@ function H(e, t, n) {
|
|
|
462
463
|
return a;
|
|
463
464
|
}
|
|
464
465
|
function U(e, t) {
|
|
465
|
-
var n, r, i, a, o, s, c,
|
|
466
|
+
var n, r, i, a, o, s, c, l = 0, d = 0, f = 0, p = e.constructor, m = p.rounding, h = p.precision;
|
|
466
467
|
if (!e.d || !e.d[0] || e.e > 17) return new p(e.d ? e.d[0] ? e.s < 0 ? 0 : Infinity : 1 : e.s ? e.s < 0 ? 0 : e : NaN);
|
|
467
|
-
for (t == null ? (
|
|
468
|
-
for (r = Math.log(
|
|
469
|
-
if (a =
|
|
470
|
-
for (i = f; i--;) o =
|
|
471
|
-
if (t == null) if (
|
|
472
|
-
else return
|
|
468
|
+
for (t == null ? (u = !1, c = h) : c = t, s = new p(.03125); e.e > -2;) e = e.times(s), f += 5;
|
|
469
|
+
for (r = Math.log(_(2, f)) / Math.LN10 * 2 + 5 | 0, c += r, n = a = o = new p(1), p.precision = c;;) {
|
|
470
|
+
if (a = P(a.times(e), c, 1), n = n.times(++d), s = o.plus(N(a, n, c, 1)), O(s.d).slice(0, c) === O(o.d).slice(0, c)) {
|
|
471
|
+
for (i = f; i--;) o = P(o.times(o), c, 1);
|
|
472
|
+
if (t == null) if (l < 3 && A(o.d, c - r, m, l)) p.precision = c += 10, n = a = s = new p(1), d = 0, l++;
|
|
473
|
+
else return P(o, p.precision = h, m, u = !0);
|
|
473
474
|
else return p.precision = h, o;
|
|
474
475
|
}
|
|
475
476
|
o = s;
|
|
476
477
|
}
|
|
477
478
|
}
|
|
478
479
|
function W(e, t) {
|
|
479
|
-
var n, r, i, a, o, s, c,
|
|
480
|
+
var n, r, i, a, o, s, c, l, d, f, p, m = 1, h = 10, g = e, _ = g.d, v = g.constructor, y = v.rounding, b = v.precision;
|
|
480
481
|
if (g.s < 0 || !_ || !_[0] || !g.e && _[0] == 1 && _.length == 1) return new v(_ && !_[0] ? -Infinity : g.s == 1 ? _ ? 0 : g : NaN);
|
|
481
|
-
if (t == null ? (
|
|
482
|
-
for (; r < 7 && r != 1 || r == 1 && n.charAt(1) > 3;) g = g.times(e), n =
|
|
482
|
+
if (t == null ? (u = !1, d = b) : d = t, v.precision = d += h, n = O(_), r = n.charAt(0), Math.abs(a = g.e) < 0x5543df729c000) {
|
|
483
|
+
for (; r < 7 && r != 1 || r == 1 && n.charAt(1) > 3;) g = g.times(e), n = O(g.d), r = n.charAt(0), m++;
|
|
483
484
|
a = g.e, r > 1 ? (g = new v("0." + n), a++) : g = new v(r + "." + n.slice(1));
|
|
484
|
-
} else return
|
|
485
|
-
for (f = g, c = o = g =
|
|
486
|
-
if (o =
|
|
487
|
-
else return
|
|
485
|
+
} else return l = L(v, d + 2, b).times(a + ""), g = W(new v(r + "." + n.slice(1)), d - h).plus(l), v.precision = b, t == null ? P(g, b, y, u = !0) : g;
|
|
486
|
+
for (f = g, c = o = g = N(g.minus(1), g.plus(1), d, 1), p = P(g.times(g), d, 1), i = 3;;) {
|
|
487
|
+
if (o = P(o.times(p), d, 1), l = c.plus(N(o, new v(i), d, 1)), O(l.d).slice(0, d) === O(c.d).slice(0, d)) if (c = c.times(2), a !== 0 && (c = c.plus(L(v, d + 2, b).times(a + ""))), c = N(c, new v(m), d, 1), t == null) if (A(c.d, d - h, y, s)) v.precision = d += h, l = o = g = N(f.minus(1), f.plus(1), d, 1), p = P(g.times(g), d, 1), i = s = 1;
|
|
488
|
+
else return P(c, v.precision = b, y, u = !0);
|
|
488
489
|
else return v.precision = b, c;
|
|
489
|
-
c =
|
|
490
|
+
c = l, i += 2;
|
|
490
491
|
}
|
|
491
492
|
}
|
|
492
493
|
function G(e) {
|
|
@@ -497,28 +498,28 @@ function K(e, t) {
|
|
|
497
498
|
for ((n = t.indexOf(".")) > -1 && (t = t.replace(".", "")), (r = t.search(/e/i)) > 0 ? (n < 0 && (n = r), n += +t.slice(r + 1), t = t.substring(0, r)) : n < 0 && (n = t.length), r = 0; t.charCodeAt(r) === 48; r++);
|
|
498
499
|
for (i = t.length; t.charCodeAt(i - 1) === 48; --i);
|
|
499
500
|
if (t = t.slice(r, i), t) {
|
|
500
|
-
if (i -= r, e.e = n = n - r - 1, e.d = [], r = (n + 1) %
|
|
501
|
-
for (r && e.d.push(+t.slice(0, r)), i -=
|
|
502
|
-
t = t.slice(r), r =
|
|
501
|
+
if (i -= r, e.e = n = n - r - 1, e.d = [], r = (n + 1) % C, n < 0 && (r += C), r < i) {
|
|
502
|
+
for (r && e.d.push(+t.slice(0, r)), i -= C; r < i;) e.d.push(+t.slice(r, r += C));
|
|
503
|
+
t = t.slice(r), r = C - t.length;
|
|
503
504
|
} else r -= i;
|
|
504
505
|
for (; r--;) t += "0";
|
|
505
|
-
e.d.push(+t),
|
|
506
|
+
e.d.push(+t), u && (e.e > e.constructor.maxE ? (e.d = null, e.e = NaN) : e.e < e.constructor.minE && (e.e = 0, e.d = [0]));
|
|
506
507
|
} else e.e = 0, e.d = [0];
|
|
507
508
|
return e;
|
|
508
509
|
}
|
|
509
|
-
function
|
|
510
|
-
var n, r, i, a,
|
|
510
|
+
function te(e, t) {
|
|
511
|
+
var n, r, i, a, o, c, l, d, p;
|
|
511
512
|
if (t.indexOf("_") > -1) {
|
|
512
|
-
if (t = t.replace(/(\d)_(?=\d)/g, "$1"),
|
|
513
|
+
if (t = t.replace(/(\d)_(?=\d)/g, "$1"), x.test(t)) return K(e, t);
|
|
513
514
|
} else if (t === "Infinity" || t === "NaN") return +t || (e.s = NaN), e.e = NaN, e.d = null, e;
|
|
514
|
-
if (
|
|
515
|
-
else if (
|
|
516
|
-
else if (
|
|
517
|
-
else throw Error(
|
|
518
|
-
for (a = t.search(/p/i), a > 0 ? (
|
|
519
|
-
return a < 0 ? new r(e.s * 0) : (e.e =
|
|
520
|
-
}
|
|
521
|
-
function
|
|
515
|
+
if (y.test(t)) n = 16, t = t.toLowerCase();
|
|
516
|
+
else if (v.test(t)) n = 2;
|
|
517
|
+
else if (b.test(t)) n = 8;
|
|
518
|
+
else throw Error(f + t);
|
|
519
|
+
for (a = t.search(/p/i), a > 0 ? (l = +t.slice(a + 1), t = t.substring(2, a)) : t = t.slice(2), a = t.indexOf("."), o = a >= 0, r = e.constructor, o && (t = t.replace(".", ""), c = t.length, a = c - a, i = ee(r, new r(n), a, a * 2)), d = j(t, n, S), p = d.length - 1, a = p; d[a] === 0; --a) d.pop();
|
|
520
|
+
return a < 0 ? new r(e.s * 0) : (e.e = I(d, p), e.d = d, u = !1, o && (e = N(e, i, c * 4)), l && (e = e.times(Math.abs(l) < 54 ? _(2, l) : s.pow(2, l))), u = !0, e);
|
|
521
|
+
}
|
|
522
|
+
function ne(e, t) {
|
|
522
523
|
var n, r = t.d.length;
|
|
523
524
|
if (r < 3) return t.isZero() ? t : q(e, 2, t, t);
|
|
524
525
|
n = 1.4 * Math.sqrt(r), n = n > 16 ? 16 : n | 0, t = t.times(1 / J(5, n)), t = q(e, 2, t, t);
|
|
@@ -526,135 +527,135 @@ function te(e, t) {
|
|
|
526
527
|
return t;
|
|
527
528
|
}
|
|
528
529
|
function q(e, t, n, r, i) {
|
|
529
|
-
var a, o, s, c,
|
|
530
|
-
for (
|
|
531
|
-
if (o =
|
|
530
|
+
var a, o, s, c, l = 1, d = e.precision, f = Math.ceil(d / C);
|
|
531
|
+
for (u = !1, c = n.times(n), s = new e(r);;) {
|
|
532
|
+
if (o = N(s.times(c), new e(t++ * t++), d, 1), s = i ? r.plus(o) : r.minus(o), r = N(o.times(c), new e(t++ * t++), d, 1), o = s.plus(r), o.d[f] !== void 0) {
|
|
532
533
|
for (a = f; o.d[a] === s.d[a] && a--;);
|
|
533
534
|
if (a == -1) break;
|
|
534
535
|
}
|
|
535
|
-
a = s, s = r, r = o, o = a,
|
|
536
|
+
a = s, s = r, r = o, o = a, l++;
|
|
536
537
|
}
|
|
537
|
-
return
|
|
538
|
+
return u = !0, o.d.length = f + 1, o;
|
|
538
539
|
}
|
|
539
540
|
function J(e, t) {
|
|
540
541
|
for (var n = e; --t;) n *= e;
|
|
541
542
|
return n;
|
|
542
543
|
}
|
|
543
544
|
function Y(e, t) {
|
|
544
|
-
var n, r = t.s < 0, i =
|
|
545
|
-
if (t = t.abs(), t.lte(a)) return
|
|
546
|
-
if (n = t.divToInt(i), n.isZero())
|
|
545
|
+
var n, r = t.s < 0, i = R(e, e.precision, 1), a = i.times(.5);
|
|
546
|
+
if (t = t.abs(), t.lte(a)) return l = r ? 4 : 1, t;
|
|
547
|
+
if (n = t.divToInt(i), n.isZero()) l = r ? 3 : 2;
|
|
547
548
|
else {
|
|
548
|
-
if (t = t.minus(n.times(i)), t.lte(a)) return
|
|
549
|
-
|
|
549
|
+
if (t = t.minus(n.times(i)), t.lte(a)) return l = V(n) ? r ? 2 : 3 : r ? 4 : 1, t;
|
|
550
|
+
l = V(n) ? r ? 1 : 4 : r ? 3 : 2;
|
|
550
551
|
}
|
|
551
552
|
return t.minus(i).abs();
|
|
552
553
|
}
|
|
553
|
-
function X(e,
|
|
554
|
-
var o,
|
|
555
|
-
if (_ ? (
|
|
554
|
+
function X(e, t, i, a) {
|
|
555
|
+
var o, s, l, u, d, f, p, m, h, g = e.constructor, _ = i !== void 0;
|
|
556
|
+
if (_ ? (k(i, 1, n), a === void 0 ? a = g.rounding : k(a, 0, 8)) : (i = g.precision, a = g.rounding), !e.isFinite()) p = G(e);
|
|
556
557
|
else {
|
|
557
|
-
for (p =
|
|
558
|
+
for (p = F(e), l = p.indexOf("."), _ ? (o = 2, t == 16 ? i = i * 4 - 3 : t == 8 && (i = i * 3 - 2)) : o = t, l >= 0 && (p = p.replace(".", ""), h = new g(1), h.e = p.length - l, h.d = j(F(h), 10, o), h.e = h.d.length), m = j(p, 10, o), s = d = m.length; m[--d] == 0;) m.pop();
|
|
558
559
|
if (!m[0]) p = _ ? "0p+0" : "0";
|
|
559
560
|
else {
|
|
560
|
-
if (l < 0 ?
|
|
561
|
+
if (l < 0 ? s-- : (e = new g(e), e.d = m, e.e = s, e = N(e, h, i, a, 0, o), m = e.d, s = e.e, f = c), l = m[i], u = o / 2, f ||= m[i + 1] !== void 0, f = a < 4 ? (l !== void 0 || f) && (a === 0 || a === (e.s < 0 ? 3 : 2)) : l > u || l === u && (a === 4 || f || a === 6 && m[i - 1] & 1 || a === (e.s < 0 ? 8 : 7)), m.length = i, f) for (; ++m[--i] > o - 1;) m[i] = 0, i || (++s, m.unshift(1));
|
|
561
562
|
for (d = m.length; !m[d - 1]; --d);
|
|
562
|
-
for (l = 0, p = ""; l < d; l++) p +=
|
|
563
|
+
for (l = 0, p = ""; l < d; l++) p += r.charAt(m[l]);
|
|
563
564
|
if (_) {
|
|
564
|
-
if (d > 1) if (
|
|
565
|
-
for (l =
|
|
566
|
-
for (m =
|
|
567
|
-
for (l = 1, p = "1."; l < d; l++) p +=
|
|
565
|
+
if (d > 1) if (t == 16 || t == 8) {
|
|
566
|
+
for (l = t == 16 ? 4 : 3, --d; d % l; d++) p += "0";
|
|
567
|
+
for (m = j(p, o, t), d = m.length; !m[d - 1]; --d);
|
|
568
|
+
for (l = 1, p = "1."; l < d; l++) p += r.charAt(m[l]);
|
|
568
569
|
} else p = p.charAt(0) + "." + p.slice(1);
|
|
569
|
-
p = p + (
|
|
570
|
-
} else if (
|
|
571
|
-
for (; ++
|
|
570
|
+
p = p + (s < 0 ? "p" : "p+") + s;
|
|
571
|
+
} else if (s < 0) {
|
|
572
|
+
for (; ++s;) p = "0" + p;
|
|
572
573
|
p = "0." + p;
|
|
573
|
-
} else if (++
|
|
574
|
-
else
|
|
574
|
+
} else if (++s > d) for (s -= d; s--;) p += "0";
|
|
575
|
+
else s < d && (p = p.slice(0, s) + "." + p.slice(s));
|
|
575
576
|
}
|
|
576
|
-
p = (
|
|
577
|
+
p = (t == 16 ? "0x" : t == 2 ? "0b" : t == 8 ? "0o" : "") + p;
|
|
577
578
|
}
|
|
578
579
|
return e.s < 0 ? "-" + p : p;
|
|
579
580
|
}
|
|
580
581
|
function Z(e, t) {
|
|
581
582
|
if (e.length > t) return e.length = t, !0;
|
|
582
583
|
}
|
|
583
|
-
function
|
|
584
|
+
function re(e) {
|
|
584
585
|
return new this(e).abs();
|
|
585
586
|
}
|
|
586
|
-
function
|
|
587
|
+
function ie(e) {
|
|
587
588
|
return new this(e).acos();
|
|
588
589
|
}
|
|
589
|
-
function
|
|
590
|
+
function ae(e) {
|
|
590
591
|
return new this(e).acosh();
|
|
591
592
|
}
|
|
592
|
-
function
|
|
593
|
+
function oe(e, t) {
|
|
593
594
|
return new this(e).plus(t);
|
|
594
595
|
}
|
|
595
|
-
function
|
|
596
|
+
function se(e) {
|
|
596
597
|
return new this(e).asin();
|
|
597
598
|
}
|
|
598
|
-
function
|
|
599
|
+
function ce(e) {
|
|
599
600
|
return new this(e).asinh();
|
|
600
601
|
}
|
|
601
|
-
function
|
|
602
|
+
function le(e) {
|
|
602
603
|
return new this(e).atan();
|
|
603
604
|
}
|
|
604
|
-
function
|
|
605
|
+
function ue(e) {
|
|
605
606
|
return new this(e).atanh();
|
|
606
607
|
}
|
|
607
|
-
function
|
|
608
|
+
function de(e, t) {
|
|
608
609
|
e = new this(e), t = new this(t);
|
|
609
610
|
var n, r = this.precision, i = this.rounding, a = r + 4;
|
|
610
|
-
return !e.s || !t.s ? n = new this(NaN) : !e.d && !t.d ? (n =
|
|
611
|
+
return !e.s || !t.s ? n = new this(NaN) : !e.d && !t.d ? (n = R(this, a, 1).times(t.s > 0 ? .25 : .75), n.s = e.s) : !t.d || e.isZero() ? (n = t.s < 0 ? R(this, r, i) : new this(0), n.s = e.s) : !e.d || t.isZero() ? (n = R(this, a, 1).times(.5), n.s = e.s) : t.s < 0 ? (this.precision = a, this.rounding = 1, n = this.atan(N(e, t, a, 1)), t = R(this, a, 1), this.precision = r, this.rounding = i, n = e.s < 0 ? n.minus(t) : n.plus(t)) : n = this.atan(N(e, t, a, 1)), n;
|
|
611
612
|
}
|
|
612
|
-
function
|
|
613
|
+
function fe(e) {
|
|
613
614
|
return new this(e).cbrt();
|
|
614
615
|
}
|
|
615
|
-
function
|
|
616
|
-
return
|
|
616
|
+
function pe(e) {
|
|
617
|
+
return P(e = new this(e), e.e + 1, 2);
|
|
617
618
|
}
|
|
618
|
-
function
|
|
619
|
+
function me(e, t, n) {
|
|
619
620
|
return new this(e).clamp(t, n);
|
|
620
621
|
}
|
|
621
|
-
function
|
|
622
|
-
if (!
|
|
623
|
-
var
|
|
622
|
+
function he(r) {
|
|
623
|
+
if (!r || typeof r != "object") throw Error(d + "Object expected");
|
|
624
|
+
var i, a, s, c = r.defaults === !0, l = [
|
|
624
625
|
"precision",
|
|
625
626
|
1,
|
|
626
|
-
|
|
627
|
+
n,
|
|
627
628
|
"rounding",
|
|
628
629
|
0,
|
|
629
630
|
8,
|
|
630
631
|
"toExpNeg",
|
|
631
|
-
-
|
|
632
|
+
-t,
|
|
632
633
|
0,
|
|
633
634
|
"toExpPos",
|
|
634
635
|
0,
|
|
635
|
-
|
|
636
|
+
t,
|
|
636
637
|
"maxE",
|
|
637
638
|
0,
|
|
638
|
-
|
|
639
|
+
t,
|
|
639
640
|
"minE",
|
|
640
|
-
-
|
|
641
|
+
-t,
|
|
641
642
|
0,
|
|
642
643
|
"modulo",
|
|
643
644
|
0,
|
|
644
645
|
9
|
|
645
646
|
];
|
|
646
|
-
for (
|
|
647
|
-
else throw Error(
|
|
648
|
-
if (
|
|
649
|
-
else throw Error(
|
|
650
|
-
else this[
|
|
651
|
-
else throw Error(
|
|
647
|
+
for (i = 0; i < l.length; i += 3) if (a = l[i], c && (this[a] = o[a]), (s = r[a]) !== void 0) if (g(s) === s && s >= l[i + 1] && s <= l[i + 2]) this[a] = s;
|
|
648
|
+
else throw Error(f + a + ": " + s);
|
|
649
|
+
if (a = "crypto", c && (this[a] = o[a]), (s = r[a]) !== void 0) if (s === !0 || s === !1 || s === 0 || s === 1) if (s) if (!e(crypto) && crypto && (crypto.getRandomValues || crypto.randomBytes)) this[a] = !0;
|
|
650
|
+
else throw Error(m);
|
|
651
|
+
else this[a] = !1;
|
|
652
|
+
else throw Error(f + a + ": " + s);
|
|
652
653
|
return this;
|
|
653
654
|
}
|
|
654
|
-
function
|
|
655
|
+
function ge(e) {
|
|
655
656
|
return new this(e).cos();
|
|
656
657
|
}
|
|
657
|
-
function
|
|
658
|
+
function _e(e) {
|
|
658
659
|
return new this(e).cosh();
|
|
659
660
|
}
|
|
660
661
|
function Q(e) {
|
|
@@ -663,7 +664,7 @@ function Q(e) {
|
|
|
663
664
|
var t, n, r, a = this;
|
|
664
665
|
if (!(a instanceof i)) return new i(e);
|
|
665
666
|
if (a.constructor = i, $(e)) {
|
|
666
|
-
a.s = e.s,
|
|
667
|
+
a.s = e.s, u ? !e.d || e.e > i.maxE ? (a.e = NaN, a.d = null) : e.e < i.minE ? (a.e = 0, a.d = [0]) : (a.e = e.e, a.d = e.d.slice()) : (a.e = e.e, a.d = e.d ? e.d.slice() : e.d);
|
|
667
668
|
return;
|
|
668
669
|
}
|
|
669
670
|
if (r = typeof e, r === "number") {
|
|
@@ -673,7 +674,7 @@ function Q(e) {
|
|
|
673
674
|
}
|
|
674
675
|
if (e < 0 ? (e = -e, a.s = -1) : a.s = 1, e === ~~e && e < 1e7) {
|
|
675
676
|
for (t = 0, n = e; n >= 10; n /= 10) t++;
|
|
676
|
-
|
|
677
|
+
u ? t > i.maxE ? (a.e = NaN, a.d = null) : t < i.minE ? (a.e = 0, a.d = [0]) : (a.e = t, a.d = [e]) : (a.e = t, a.d = [e]);
|
|
677
678
|
return;
|
|
678
679
|
}
|
|
679
680
|
if (e * 0 != 0) {
|
|
@@ -682,11 +683,11 @@ function Q(e) {
|
|
|
682
683
|
}
|
|
683
684
|
return K(a, e.toString());
|
|
684
685
|
}
|
|
685
|
-
if (r === "string") return (n = e.charCodeAt(0)) === 45 ? (e = e.slice(1), a.s = -1) : (n === 43 && (e = e.slice(1)), a.s = 1),
|
|
686
|
+
if (r === "string") return (n = e.charCodeAt(0)) === 45 ? (e = e.slice(1), a.s = -1) : (n === 43 && (e = e.slice(1)), a.s = 1), x.test(e) ? K(a, e) : te(a, e);
|
|
686
687
|
if (r === "bigint") return e < 0 ? (e = -e, a.s = -1) : a.s = 1, K(a, e.toString());
|
|
687
|
-
throw Error(
|
|
688
|
+
throw Error(f + e);
|
|
688
689
|
}
|
|
689
|
-
if (i.prototype =
|
|
690
|
+
if (i.prototype = D, i.ROUND_UP = 0, i.ROUND_DOWN = 1, i.ROUND_CEIL = 2, i.ROUND_FLOOR = 3, i.ROUND_HALF_UP = 4, i.ROUND_HALF_DOWN = 5, i.ROUND_HALF_EVEN = 6, i.ROUND_HALF_CEIL = 7, i.ROUND_HALF_FLOOR = 8, i.EUCLID = 9, i.config = i.set = he, i.clone = Q, i.isDecimal = $, i.abs = re, i.acos = ie, i.acosh = ae, i.add = oe, i.asin = se, i.asinh = ce, i.atan = le, i.atanh = ue, i.atan2 = de, i.cbrt = fe, i.ceil = pe, i.clamp = me, i.cos = ge, i.cosh = _e, i.div = ve, i.exp = ye, i.floor = be, i.hypot = xe, i.ln = Se, i.log = Ce, i.log10 = Te, i.log2 = we, i.max = Ee, i.min = De, i.mod = Oe, i.mul = ke, i.pow = Ae, i.random = je, i.round = Me, i.sign = Ne, i.sin = Pe, i.sinh = Fe, i.sqrt = Ie, i.sub = Le, i.sum = Re, i.tan = ze, i.tanh = Be, i.trunc = Ve, e === void 0 && (e = {}), e && e.defaults !== !0) for (r = [
|
|
690
691
|
"precision",
|
|
691
692
|
"rounding",
|
|
692
693
|
"toExpNeg",
|
|
@@ -698,105 +699,105 @@ function Q(e) {
|
|
|
698
699
|
], t = 0; t < r.length;) Object.prototype.hasOwnProperty.call(e, n = r[t++]) || (e[n] = this[n]);
|
|
699
700
|
return i.config(e), i;
|
|
700
701
|
}
|
|
701
|
-
function
|
|
702
|
+
function ve(e, t) {
|
|
702
703
|
return new this(e).div(t);
|
|
703
704
|
}
|
|
704
|
-
function
|
|
705
|
+
function ye(e) {
|
|
705
706
|
return new this(e).exp();
|
|
706
707
|
}
|
|
707
|
-
function
|
|
708
|
-
return
|
|
708
|
+
function be(e) {
|
|
709
|
+
return P(e = new this(e), e.e + 1, 3);
|
|
709
710
|
}
|
|
710
|
-
function
|
|
711
|
+
function xe() {
|
|
711
712
|
var e, t, n = new this(0);
|
|
712
|
-
for (
|
|
713
|
+
for (u = !1, e = 0; e < arguments.length;) if (t = new this(arguments[e++]), t.d) n.d && (n = n.plus(t.times(t)));
|
|
713
714
|
else {
|
|
714
|
-
if (t.s) return
|
|
715
|
+
if (t.s) return u = !0, new this(Infinity);
|
|
715
716
|
n = t;
|
|
716
717
|
}
|
|
717
|
-
return
|
|
718
|
+
return u = !0, n.sqrt();
|
|
718
719
|
}
|
|
719
720
|
function $(e) {
|
|
720
|
-
return e instanceof
|
|
721
|
+
return e instanceof s || e?.toStringTag === h || !1;
|
|
721
722
|
}
|
|
722
|
-
function
|
|
723
|
+
function Se(e) {
|
|
723
724
|
return new this(e).ln();
|
|
724
725
|
}
|
|
725
|
-
function
|
|
726
|
+
function Ce(e, t) {
|
|
726
727
|
return new this(e).log(t);
|
|
727
728
|
}
|
|
728
|
-
function
|
|
729
|
+
function we(e) {
|
|
729
730
|
return new this(e).log(2);
|
|
730
731
|
}
|
|
731
|
-
function
|
|
732
|
+
function Te(e) {
|
|
732
733
|
return new this(e).log(10);
|
|
733
734
|
}
|
|
734
|
-
function
|
|
735
|
+
function Ee() {
|
|
735
736
|
return H(this, arguments, -1);
|
|
736
737
|
}
|
|
737
|
-
function
|
|
738
|
+
function De() {
|
|
738
739
|
return H(this, arguments, 1);
|
|
739
740
|
}
|
|
740
|
-
function
|
|
741
|
+
function Oe(e, t) {
|
|
741
742
|
return new this(e).mod(t);
|
|
742
743
|
}
|
|
743
|
-
function
|
|
744
|
+
function ke(e, t) {
|
|
744
745
|
return new this(e).mul(t);
|
|
745
746
|
}
|
|
746
|
-
function
|
|
747
|
+
function Ae(e, t) {
|
|
747
748
|
return new this(e).pow(t);
|
|
748
749
|
}
|
|
749
|
-
function
|
|
750
|
-
var
|
|
751
|
-
if (e === void 0 ? e = this.precision :
|
|
752
|
-
else if (crypto.getRandomValues) for (
|
|
750
|
+
function je(e) {
|
|
751
|
+
var t, r, i, a, o = 0, s = new this(1), c = [];
|
|
752
|
+
if (e === void 0 ? e = this.precision : k(e, 1, n), i = Math.ceil(e / C), !this.crypto) for (; o < i;) c[o++] = Math.random() * 1e7 | 0;
|
|
753
|
+
else if (crypto.getRandomValues) for (t = crypto.getRandomValues(new Uint32Array(i)); o < i;) a = t[o], a >= 429e7 ? t[o] = crypto.getRandomValues(new Uint32Array(1))[0] : c[o++] = a % 1e7;
|
|
753
754
|
else if (crypto.randomBytes) {
|
|
754
|
-
for (
|
|
755
|
+
for (t = crypto.randomBytes(i *= 4); o < i;) a = t[o] + (t[o + 1] << 8) + (t[o + 2] << 16) + ((t[o + 3] & 127) << 24), a >= 214e7 ? crypto.randomBytes(4).copy(t, o) : (c.push(a % 1e7), o += 4);
|
|
755
756
|
o = i / 4;
|
|
756
|
-
} else throw Error(
|
|
757
|
-
for (i = c[--o], e %=
|
|
757
|
+
} else throw Error(m);
|
|
758
|
+
for (i = c[--o], e %= C, i && e && (a = _(10, C - e), c[o] = (i / a | 0) * a); c[o] === 0; o--) c.pop();
|
|
758
759
|
if (o < 0) r = 0, c = [0];
|
|
759
760
|
else {
|
|
760
|
-
for (r = -1; c[0] === 0; r -=
|
|
761
|
+
for (r = -1; c[0] === 0; r -= C) c.shift();
|
|
761
762
|
for (i = 1, a = c[0]; a >= 10; a /= 10) i++;
|
|
762
|
-
i <
|
|
763
|
+
i < C && (r -= C - i);
|
|
763
764
|
}
|
|
764
765
|
return s.e = r, s.d = c, s;
|
|
765
766
|
}
|
|
766
|
-
function je(e) {
|
|
767
|
-
return N(e = new this(e), e.e + 1, this.rounding);
|
|
768
|
-
}
|
|
769
767
|
function Me(e) {
|
|
770
|
-
return e = new this(e), e.
|
|
768
|
+
return P(e = new this(e), e.e + 1, this.rounding);
|
|
771
769
|
}
|
|
772
770
|
function Ne(e) {
|
|
773
|
-
return new this(e).
|
|
771
|
+
return e = new this(e), e.d ? e.d[0] ? e.s : 0 * e.s : e.s || NaN;
|
|
774
772
|
}
|
|
775
773
|
function Pe(e) {
|
|
776
|
-
return new this(e).
|
|
774
|
+
return new this(e).sin();
|
|
777
775
|
}
|
|
778
776
|
function Fe(e) {
|
|
777
|
+
return new this(e).sinh();
|
|
778
|
+
}
|
|
779
|
+
function Ie(e) {
|
|
779
780
|
return new this(e).sqrt();
|
|
780
781
|
}
|
|
781
|
-
function
|
|
782
|
+
function Le(e, t) {
|
|
782
783
|
return new this(e).sub(t);
|
|
783
784
|
}
|
|
784
|
-
function
|
|
785
|
+
function Re() {
|
|
785
786
|
var e = 0, t = arguments, n = new this(t[e]);
|
|
786
|
-
for (
|
|
787
|
-
return
|
|
787
|
+
for (u = !1; n.s && ++e < t.length;) n = n.plus(t[e]);
|
|
788
|
+
return u = !0, P(n, this.precision, this.rounding);
|
|
788
789
|
}
|
|
789
|
-
function
|
|
790
|
+
function ze(e) {
|
|
790
791
|
return new this(e).tan();
|
|
791
792
|
}
|
|
792
|
-
function
|
|
793
|
+
function Be(e) {
|
|
793
794
|
return new this(e).tanh();
|
|
794
795
|
}
|
|
795
|
-
function
|
|
796
|
-
return
|
|
796
|
+
function Ve(e) {
|
|
797
|
+
return P(e = new this(e), e.e + 1, 1);
|
|
797
798
|
}
|
|
798
|
-
|
|
799
|
-
var
|
|
799
|
+
s = Q(o), s.prototype.constructor = s, s.default = s.Decimal = s, i = new s(i), a = new s(a);
|
|
800
|
+
var He = s;
|
|
800
801
|
//#endregion
|
|
801
|
-
export {
|
|
802
|
+
export { s as Decimal, He as default };
|
|
802
803
|
/* 独立思考,明辨是非 */
|