MCPcopy
hub / github.com/formatjs/formatjs / abs

Method abs

packages/bigdecimal/index.ts:357–368  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

355 }
356
357 abs(): BigDecimal {
358 if (this._special === SpecialValue.NAN) return this
359 if (this._special === SpecialValue.NEGATIVE_INFINITY) {
360 return BigDecimal._create(0n, 0, SpecialValue.POSITIVE_INFINITY, false)
361 }
362 return BigDecimal._create(
363 bigintAbs(this._mantissa),
364 this._exponent,
365 this._special,
366 false
367 )
368 }
369
370 negated(): BigDecimal {
371 if (this._special === SpecialValue.NAN) return this

Callers 11

bigdecimal.test.tsFile · 0.80
offsetToGmtStringFunction · 0.80
GetOperandsFunction · 0.80
ResolvePluralInternalFunction · 0.80
selectUnitFunction · 0.80
FormattedRelativeTimeFunction · 0.80
ToIntegerFunction · 0.80
TimeClipFunction · 0.80
containingMethod · 0.80

Calls 2

bigintAbsFunction · 0.85
_createMethod · 0.80

Tested by

no test coverage detected