Interface RatNum<Name>

A constant Rational value expression

const num = Real.val('1/3');

num.asString()
// '1/3'
num.value
// { numerator: 1n, denominator: 3n }
num.asNumber()
// 0.3333333333333333
interface RatNum<Name extends string = "main"> {
    ctx: Context<Name>;
    get ast(): Z3_ast;
    get sort(): S;
    add(other: CoercibleToArith<Name>): Arith<Name>;
    arg(i: number): AnyExpr<Name>;
    asDecimal(prec?: number): string;
    asNumber(): number;
    asString(): string;
    children(): AnyExpr<Name>[];
    decl(): FuncDecl<Name, Sort<Name>[], Sort<Name>>;
    denominator(): IntNum<Name>;
    div(other: CoercibleToArith<Name>): Arith<Name>;
    eq(other: CoercibleToExpr<Name>): Bool<Name>;
    eqIdentity(other: Ast<Name, unknown>): boolean;
    ge(other: CoercibleToArith<Name>): Bool<Name>;
    gt(other: CoercibleToArith<Name>): Bool<Name>;
    hash(): number;
    id(): number;
    le(other: CoercibleToArith<Name>): Bool<Name>;
    lt(other: CoercibleToArith<Name>): Bool<Name>;
    mod(other: CoercibleToArith<Name>): Arith<Name>;
    mul(other: CoercibleToArith<Name>): Arith<Name>;
    name(): string | number;
    neg(): Arith<Name>;
    neq(other: CoercibleToExpr<Name>): Bool<Name>;
    neqIdentity(other: Ast<Name, unknown>): boolean;
    numArgs(): number;
    numerator(): IntNum<Name>;
    params(): (
        | string
        | number
        | Sort<Name>
        | FuncDecl<Name, Sort<Name>[], Sort<Name>>
        | Expr<Name, AnySort<Name>, unknown>
    )[];
    pow(exponent: CoercibleToArith<Name>): Arith<Name>;
    sexpr(): string;
    sub(other: CoercibleToArith<Name>): Arith<Name>;
    value(): { denominator: bigint; numerator: bigint };
}

Type Parameters

  • Name extends string = "main"

Hierarchy (View Summary)

Properties

Accessors

Methods

  • Returns { denominator: bigint; numerator: bigint }