mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 04:58:24 +01:00
first
This commit is contained in:
parent
bd62d51ec9
commit
b578433e37
1 changed files with 784842 additions and 0 deletions
32
Brutal.Core/Numerics/IAssociativeArithmeticOperators.cs
Normal file
32
Brutal.Core/Numerics/IAssociativeArithmeticOperators.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using System.Numerics;
|
||||
|
||||
namespace Brutal.Numerics;
|
||||
|
||||
public interface IArithmeticOperators<TSelf, TOther, TResult>
|
||||
: IAdditionOperators<TSelf, TOther, TResult>,
|
||||
ISubtractionOperators<TSelf, TOther, TResult>,
|
||||
IMultiplyOperators<TSelf, TOther, TResult>,
|
||||
IDivisionOperators<TSelf, TOther, TResult>
|
||||
where TSelf : IArithmeticOperators<TSelf, TOther, TResult>?;
|
||||
|
||||
public interface IAssociativeArithmeticOperators<TSelf, TOther, TResult> : IArithmeticOperators<TSelf, TOther, TResult>
|
||||
where TSelf : IAssociativeArithmeticOperators<TSelf, TOther, TResult>?
|
||||
{
|
||||
static abstract TResult operator +(TOther left, TSelf right);
|
||||
|
||||
static abstract TResult operator -(TOther left, TSelf right);
|
||||
|
||||
static abstract TResult operator *(TOther left, TSelf right);
|
||||
|
||||
static abstract TResult operator /(TOther left, TSelf right);
|
||||
|
||||
#pragma warning disable CS8604 // Possible null reference argument.
|
||||
static virtual TResult operator checked +(TOther left, TSelf right) => unchecked(left + right);
|
||||
|
||||
static virtual TResult operator checked -(TOther left, TSelf right) => unchecked(left - right);
|
||||
|
||||
static virtual TResult operator checked *(TOther left, TSelf right) => unchecked(left * right);
|
||||
|
||||
static virtual TResult operator checked /(TOther left, TSelf right) => unchecked(left / right);
|
||||
#pragma warning restore CS8604 // Possible null reference argument.
|
||||
}
|
||||
Loading…
Reference in a new issue