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.

Tipo
interface
Espacio de nombres
System
Ensamblado
System.Core
Acceso
public
Archivo fuente
Numbers.ant

Parámetros de tipo

NombreRestricciones
TSelfplain, INumber<TSelf>, operador +, operador -, operador *, operador /, operador %, operador ==, operador <

Herencia

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

Miembros privados e internos (4)

static FromF64(f64 value) : 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 ToF64(TSelf value) : f64
#

private static abstract

The number as an f64.

static TSelf Zero { base get; }
#

private static read-only

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

static TSelf One { base get; }
#

private static read-only

The number one.

Código fuente

INumber<TSelf> en Antril, descompilado a partir de su Larva HIR.

System.INumber.ant
// 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; }
	}
}
Esc