isNegative

Returns whether the receiver has a negative sign.

import { Arith } from "@teakit/arith";

const x = Arith.from("-0");
x.isNegative(); // true
x.valueOf(); // "-0"

Arith.from("2").isNegative(); // false
Arith.from("-Infinity").isNegative(); // true
Arith.from("NaN").isNegative(); // false

API Reference

Signature

isNegative(): boolean;

Parameters

ParameterTypeRequiredNotes
None--This method does not take parameters.

Returns

Returns a boolean.

Throws

  • Does not take user arguments; no argument validation is performed.

Agent Contract

FieldValue
Kindinstance method
Canonical nameisNegative
AliasesNone
Mutates receiverNo
Returnsboolean
Accepts (string, base) overloadNo
Configuration dependenciesNone
Related methodsisFinite, isInteger, isNaN, isZero

Agent Notes

  • Use predicate methods instead of inspecting c, e, or s directly.
  • Import with import { Arith } from "@teakit/arith"; default imports are unsupported.
  • Use Arith.from(...) to create values. Do not generate new Arith(...) or Arith(...).
  • Use string inputs for exact decimal values, especially money-like values.
  • Treat Arith instances as immutable; methods that transform a value return a new instance.
  • Do not mutate internal fields such as c, e, s, or _isArith.