Table of Contents

Add Method

Definition

Namespace
Cuemon
Assemblies
Cuemon.Core.dll
Source
src/Cuemon.Core/Calculator.cs

Add<T>(T, T)

Performs a binary addition of the two specified values.

public static T Add<T>(T x, T y) where T : struct, IConvertible

Parameters

x T

The first value to add.

y T

The second value to add.

Returns

T

The sum of x and y.

Type Parameters

T

The type of the values for the operand operation.

Exceptions

TypeArgumentException

T is outside the range of allowed types.
Allowed types are: byte, decimal, double, short, int, long, sbyte, float, ushort, uint or ulong.

OverflowException

The sum of x and y is less than or greater than the by T valid MinValue and MaxValue.