MCPcopy Create free account
hub / github.com/effect-app/libs / toExponential

Function toExponential

repos/effect/packages/effect/src/BigDecimal.ts:1537–1554  ·  view source on GitHub ↗
(n: BigDecimal)

Source from the content-addressed store, hash-verified

1535 * BigDecimal.isNegative(BigDecimal.fromStringUnsafe("-1")) // => true
1536 * BigDecimal.isNegative(BigDecimal.fromStringUnsafe("0")) // => false
1537 * BigDecimal.isNegative(BigDecimal.fromStringUnsafe("1")) // => false
1538 * ```
1539 *
1540 * @category predicates
1541 * @since 2.0.0
1542 */
1543export const isNegative = (n: BigDecimal): boolean => n.value < bigint0
1544
1545/**
1546 * Checks whether a given `BigDecimal` is positive.
1547 *
1548 * **When to use**
1549 *
1550 * Use to test whether a `BigDecimal` is greater than zero.
1551 *
1552 * **Example** (Checking positive decimals)
1553 *
1554 * ```ts import.meta.vitest
1555 * import { BigDecimal } from "effect"
1556 *
1557 * BigDecimal.isPositive(BigDecimal.fromStringUnsafe("-1")) // => false

Callers 1

formatFunction · 0.85

Calls 4

isZeroFunction · 0.70
normalizeFunction · 0.70
absFunction · 0.70
isNegativeFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…