ceil

Returns the smallest integer greater than or equal to the receiver.

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

Arith.from("1.2").ceil().toString(); // "2"
Arith.from("-1.2").ceil().toString(); // "-1"
Arith.from("2").ceil().toString(); // "2"

// ceil is equivalent to integer rounding toward positive infinity.
Arith.from("123.456").integerValue(Arith.ROUND_CEIL).toString(); // "124"

// Use the static helper when no method chain is needed.
Arith.ceil("1.2").toString(); // "2"

API Reference

Signature

ceil(): ArithInstance;

Parameters

This method does not take parameters.

Returns

Returns a new Arith instance rounded toward positive infinity.

Throws

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

Agent Contract

FieldValue
Kindinstance method and static helper
Canonical nameceil
AliasesNone
Mutates receiverNo
ReturnsArithInstance
Accepts (string, base) overloadNo
Configuration dependenciesNone
Related methodsfloor, round, trunc, integerValue

Agent Notes

  • Prefer ceil() over integerValue(Arith.ROUND_CEIL) in generated business code.
  • Use Arith.from(...) to create values. Do not generate new Arith(...) or Arith(...).
  • Treat Arith instances as immutable.