interface · System
INumber<TSelf>
public interface INumber<TSelf : INumber<TSelf>, plain, op +(TSelf, TSelf) : TSelf, op -(TSelf, TSelf) : TSelf, op *(TSelf, TSelf) : TSelf, op /(TSelf, TSelf) : TSelf, op %(TSelf, TSelf) : TSelf, op ==(TSelf, TSelf) : bool, op <(TSelf, TSelf) : bool>
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
| Name | Constraints |
|---|---|
TSelf | plain, INumber<TSelf>, operator +, operator -, operator *, operator /, operator %, operator ==, operator < |
Inheritance
- Implemented by
-
Float128Float16Float256Float32Float64ISignedNumber<TSelf>Int128Int16Int256Int32Int64Int8UInt128UInt16UInt256UInt32UInt64UInt8
Private and internal members (4)
Source
INumber<TSelf> as Antril, decompiled from its Larva HIR.
// System.INumber — System.Core (decompiled from Larva HIR)
into namespace System
{
/// A number: `+`, `-`, `*`, `/`, `%`, `==` and `<` on two of them (so `!=` and `>` too), the constants Zero and
/// One, and FromF64/ToF64. `T : number`.
public interface INumber<TSelf : INumber<TSelf>, plain, op +(TSelf, TSelf) : TSelf, op -(TSelf, TSelf) : TSelf, op *(TSelf, TSelf) : TSelf, op /(TSelf, TSelf) : TSelf, op %(TSelf, TSelf) : TSelf, op ==(TSelf, TSelf) : bool, op <(TSelf, TSelf) : bool>
{
/// `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 FromF64(f64 value) : TSelf;
/// The number as an f64.
static ToF64(TSelf value) : f64;
/// The number zero (what `default(T)` is too).
static TSelf Zero { base get; }
/// The number one.
static TSelf One { base get; }
}
}