Asp.Net Core

Numerics

Asp.Net Core / Numerics

Numerics

Integral types

.NET Core supports both signed and unsigned integers of different ranges from one byte to eight bytes in length. All integers are value types.

The following table represents the integral types and their size;

TypeSigned/ UnsignedSize (bytes)Minimum ValueMaximum Value
ByteUnsigned10255
Int16Signed232,76832,767
Int32Signed42,147,483,6482,147,483,647
Int64Signed89,223,372,036,854,775,8089,223,372,036,854,775,807
SByteSigned1-128127
UInt16Unsigned2065,535
UInt32Unsigned404,294,967,295
UInt64Unsigned8018,446,744,073,709,551,615

Each integral type supports a standard set of arithmetic, comparison, equality, explicit conversion, and implicit conversion operators.

Floating-point types

.NET Core includes three primitive floating point types, which are shown in the following table.

TypeSize (bytes)Minimum ValueMaximum Value
Double81.79769313486232e3081.79769313486232e308
Single43.402823e383.402823e38
Decimal1679,228,162,514,264,337,593,5 43,950,33579,228,162,514,264,337,593,543,9 50,335

Each floating-point type supports a standard set of arithmetic, comparison, equality, explicit conversion, and implicit conversion operators.

You can also work with the individual bits in Double and Single values by using the BitConverter class.

The Decimal structure has its own methods, Decimal.GetBits and Decimal.Decimal(Int32()), for working with a decimal value's individual bits, as well as its own set of methods for performing some additional mathematical operations.

BigInteger

System.Numerics.BigInteger is an immutable type that represents an arbitrarily large integer whose value in theory has no upper or lower bounds.

The methods of the BigInteger type is closely parallel to those of the other integral types.

 

Complex

The System.Numerics.Complex type represents a complex number, i.e., a number with a real number part and an imaginary number part

It supports a standard set of arithmetic, comparison, equality, explicit conversion, and implicit conversion operators, as well as mathematical, algebraic, and trigonometric methods.

Technology
Asp.Net Core
want to connect with us ?
Contact Us