interface · System

INumber<TSelf>

public interface System.INumber<TSelf>

A number: +, -, *, /, %, == and < on two of them (so != and > too), the constants Zero and One, and FromF64/ToF64. T : number.

Kind
interface
Namespace
System
Assembly
System.Core
Access
public
Source file
Numbers.ant

Type parameters

NameConstraints
TSelfplain, System.INumber<TSelf>, operator +, operator -, operator *, operator /, operator %, operator ==, operator <

Inheritance

Implemented by
Float128 Float16 Float256 Float32 Float64 ISignedNumber<TSelf> Int128 Int16 Int256 Int32 Int64 Int8 UInt128 UInt16 UInt256 UInt32 UInt64 UInt8

Private and internal members (4)

static method FromF64(value: f64) -> TSelf
#

private static abstract

value as this type of number (an integer drops the fraction): how Math reaches the floating-point functions (Sqrt, Sin, Pow, ...) from any number.

static method ToF64(value: TSelf) -> f64
#

private static abstract

The number as an f64.

static property Zero: TSelf
#

private static read-only

The number zero (what default(T) is too).

static property One: TSelf
#

private static read-only

The number one.

Source

INumber<TSelf> as Larva HIR, decompiled from its Larva HIR.

System.INumber.hir
// A number: `+`, `-`, `*`, `/`, `%`, `==` and `<` on two of them (so `!=` and `>` too), the constants Zero and
// One, and FromF64/ToF64. `T : number`.
public interface System.INumber<TSelf>
{
    // `value` as this type of number (an integer drops the fraction): how Math reaches the floating-point
    // functions (Sqrt, Sin, Pow, ...) from any number.
    static method FromF64(value: f64) -> TSelf
    // The number as an f64.
    static method ToF64(value: TSelf) -> f64
    // The number zero (what `default(T)` is too).
    static property Zero: TSelf
    // The number one.
    static property One: TSelf
}
Esc