VB.NET ASPNET Math Function Examples

VB.NET ASPNET Math Function Examples

Purpose: – Illustrates for .


VB.NET ASPNET Math Function Examples

Math Functions Input Expression & Purpose Result
Abs(expression) Decimal, Double, Int16, Int32, Int64, SByte, Single – absolute value is returned Data
Type
of
Input
Acos(double) Double – takes a cosine as double data type number and returns a double value that represents the angle in radians Double
Data
Type
Asin(double) Double – takes a double data type number that represents a sine and returns a double value that represents the angle of that sine when measured in radians. Double
Data
Type
Atan(double) Double – converts a tangent to radians of an angle. The function takes a double data type number and returns a double value that repesents the radians of the angle for that tangent. Double
Data
Type
Atan2(y as double, x as double) Double – y is the y coordinate of a point; Double – x is the x coordinate of a point; This function takes 2 double data type numbers and returns a double value containing the angle (measured in radians) whose tangent is the quotient of two specified numbers Double
Data
Type
BigMul(int1 as Int32, int2 as Int32) Int32 – int1; Int32 – int2; This function takes 2 32-bit integer numbers and returns their full product as a 64-bit integer Int64
Data
Type
Ceiling(decimalnumber) or Ceiling(doublenumber) Decimal or Double – This function takes a decimal or double number and returns a value that represents the next equal or higher whole number. Data
Type
of
Input
Cos(doublenumber) Double – This function converts an angle measured in radians to a cosine. Double
Data
Type
Cosh(doublenumber) Double – This function takes an angle specified in radians and returns the hyperbolic cosine for the angle as a double data type. Double
Data
Type
DivRem(dividend32, divisor32, byRef remainder32) or DivRem(dividend64, divisor64, byRef remainder64) dividend32, divisor32, byRef remainder32 or dividend64, divisor64, byRef remainder64 – This function takes an dividend, divisor, and remainder as Int32 or Int64 and returns quotient as same data type. Remainder is passed by reference and it gets updated with the remainder when the function executes. Int32
Or
Int64
Exp(doublenumber) doublenumber – This function takes a double data type number and returns a double value containing e (the base of natural logarithms) raised to the specified power. Double
Data
Type
Floor(decimalnumber) or Floor(doublenumber) decimalnumber or doublenumber – This function takes a decimal or double number and returns a value that represents the next equal or lower whole number. Data
Type
of
Input
IEEERemainder(dividend as double, divisor as double) dividend as double, divisor as double – This function takes an dividend and divisor as double data type and returns the remainder as double data type. Double
Data
Type
Log(doublenumber) Double – This function takes a double data type number and returns the natural (base e) logarithm as a double data type. Double
Data
Type
Log10(doublenumber) Double – This function takes a double data type number and returns the base 10 logarithm as a double data type. Double
Data
Type
Max(byte,byte)
Max(decimal, decimal)
Max(double, double)
Max(int16, int16)
Max(int32, int32)
Max(int64, int64)
Max(sbyte, sbyte)
Max(single, single)
Max(UInt16, UInt16)
Max(UInt32, UInt32)
Max(UInt64, UInt64)
expression – This function returns the Max value of the two parameters that were passed in. Data
Type
of
Input
Min(byte,byte)
Min(decimal, decimal)
Min(double, double)
Min(int16, int16)
Min(int32, int32)
Min(int64, int64)
Min(sbyte, sbyte)
Min(single, single)
Min(UInt16, UInt16)
Min(UInt32, UInt32)
Min(UInt64, UInt64)
expression – This function returns the min value of the two parameters that were passed in. Data
Type
of
Input
Pow(doublenumberbase, doublenumberpower) Double – This function takes two double data type numbers and raises the first number to the power of the second. The result is returned as a double data type. Double
Data
Type
1. Round(decimal)
2. Round(decimal, int32)
3. Round(decimal, mode)
4. Round(decimal, int32, mode)
5. Round(double)
6. Round(double, int32)
7. Round(double, mode)
8. Round(double, int32, mode)
various inputs – takes a decimal or double as input parameter1 and returns the number rounded to the specified number of fractional decimals. If parameter 2 is not used, result is rounded to whole number. Parameter3 specifies rounding mode. Decimal
or
Double
1. Sign(decimal)
2. Sign(double)
3. Sign(int16)
4. Sign(int32)
5. Sign(int64)
6. Sign(SByte)
7. Sign(Single)
Various inputs – This function returns an integer indicating the sign of the input parameter. The result is -1 if the input parameter is less than one; 0 if the input is zero; and 1 if the input is > 0 Data
Type
of
Input
Sin(doublenumber) Double – This function converts an angle measured in radians to a Sine. Double
Data
Type
Sinh(doublenumber) Double – This function takes an angle specified in radians and returns the hyperbolic sine for the angle as a double data type. Double
Data
Type
Sqrt(doublenumber) Double – This function takes number as a double data type and returns the square root as a double data type. Double
Data
Type
Tan(doublenumber) Double – This function converts an angle measured in radians to a tangent. Double
Data
Type
Tanh(doublenumber) Double – This function converts an angle measured in radians to a hyperbolic tangent. Double
Data
Type
1. Truncate(decimal)
2. Truncate(double)
Decimal or Double – This function takes a decimal or double as input parameter1 and returns the number truncated without the fractional decimals. Decimal
or
Double