Recommended: How to learn ASP file reference The #include command is used to create functions, headers, footers or other elements that need to be reused on multiple pages. #include command By using the #include command, we can insert another ASP file into this text before the server executes an ASP file.
【name】
Abs
【category】
Mathematical functions
【Actoform】
Abs(number)
【parameter】
Required. The Number parameter is any valid numeric expression
【Return Value】
Types of the same number
【Exception/Error】
none
【describe】
Returns the absolute value of the parameter number. The absolute value of a number is the value after removing the positive and negative signs. For example, both ABS(-1) and ABS(1) return 1. Abs(5.2)=5.2, Abs(-5)=5
【Example】
Dim MyNumber
MyNumber = Abs(50.3) ' Returns 50.3.
MyNumber = Abs(-50.3) ' Returns 50.3.
【Remark】
Returns Null if number contains Null, and 0 if number is an uninitialized variable.
【name】
Atn
【category】
Mathematical functions
【Actoform】
Atn(number)
【parameter】
Required, the number parameter is a Double or any valid numeric expression.
【Return Value】
Double Type
【Exception/Error】
none
【describe】
Returns the arctangent value of the parameter number.
【Example】
Dim pi
pi = 4 * Atn(1) ' Calculate the pi.
【Remark】
The parameter value of the Atn function is the ratio of both sides of a right triangle and returns the angle in radians. This ratio is the quotient of the opposite side length of the angle divided by the quotient of the adjacent side length of the angle. The range of values is between -pi/2 and pi/2 radians. To convert the angle to radians, multiply the angle by pi/180. To convert radians to angles, multiply radians by 180/pi.
Note: Atn is Tan's inverse trigonometric function. The parameter value of Tan is angle, which returns the ratio of the two sides of a right triangle. Do not confuse Atn and cotangent functions, the cotangent value is the inverse of the tangent value, cotangent = (1/tangent).
【name】
Cos
【category】
Mathematical functions
【Actoform】
Cos(number)
【parameter】
Required, the number parameter is Double or any valid numeric expression that represents an angle in radians.
【Return Value】
Double Type
【Exception/Error】
none
【describe】
Returns a cosine value that specifies an angle.
【Example】
Dim MyAngle, MySecant
MyAngle = 1.3 ' Define angle (in radians).
MySecant = 1 / Cos(MyAngle) ' Use cosine to calculate the forward separation (sec()).
【Remark】
The parameter of the Cos function is an angle and returns the ratio of both sides of the right triangle. This ratio is the quotient of the adjacent edge length of the angle divided by the oblique length. The result has a value range of -1 to 1.
To convert the angle to radians, multiply the angle by pi/180. To convert radians to angles, multiply radians by 180/pi.
【name】
Exp
【category】
Mathematical functions
【Actoform】
Exp(number)
【parameter】
Required, the number parameter is a Double or any valid numeric expression
【Return Value】
Double Type
【Exception/Error】
none
【describe】
Returns a certain power of a specified e (the base of natural logarithm, with the value of e being 2.71828).
【Example】
' This example uses the Exp function to calculate a power of e.
Dim MyAngle, MyHSin
' Define the angle (in radians).
MyAngle = 1.3
' Calculate the hyperbolic sine function value (sin()).
MyHSin = (Exp(MyAngle) - Exp(-1 * MyAngle)) / 2
【Remark】
If the value of number exceeds 709.782712893, an error will occur. The value of the constant e is approximately 2.718282. Note: The effect of the Exp function and the effect of Log are complementary, so it is sometimes called an anti-log.
【name】
Fix
【category】
Mathematical functions
【Actoform】
Fix (number)
【parameter】
Required, the number parameter is a Double or any valid numeric expression
【Return Value】
Integer Type
【Exception/Error】
none
【describe】
Cut off the decimal part of number and find its integer part, for example: Fix(3.8)=3, Fix(-3.8)=-3.
【Example】
Dim MyNumber
MyNumber = Fix(99.2) ' Returns 99.
MyNumber = Fix(-99.8) ' Returns -99.
MyNumber = Fix(-99.2) ' Returns -99.
【Remark】
If number contains Null, Null is returned.
【name】
Int
【category】
Mathematical functions
【Actoform】
Int(number)
【parameter】
Required, the number parameter is a Double or any valid numeric expression
【Return Value】
Integer Type
【Exception/Error】
none
【describe】
Find the maximum integer not greater than number, Int(3.8)=3, Int(-3.8)=-4.
【Example】
Dim MyNumber
MyNumber = Int(99.8) ' Returns 99.
MyNumber = Int(-99.8) ' Returns -100.
MyNumber = Int(-99.2) ' Returns -100.
【Remark】
If number contains Null, Null is returned. Both Int and Fix delete the decimal part of number and return the remaining integer. The difference between Int and Fix is that if number is negative, Int returns the first negative integer less than or equal to number, while Fix returns the first negative integer greater than or equal to number. For example, Int converts -8.4 to -9, and Fix converts -8.4 to -8.
【name】
Log
【category】
Mathematical functions
【Actoform】
Log(number)
【parameter】
Required, the number parameter is a Double or any valid numeric expression greater than 0.
【Return Value】
Double Type
【Exception/Error】
none
【describe】
Returns the natural logarithmic value of the specified number parameter.
【Example】
This example uses the Log function to get the natural logarithmic value of a certain number.
Dim MyAngle, MyLog
' Define the angle (in radians).
MyAngle = 1.3
' Calculate the inverse hyperbolic sine function value (inverse sinh()).
MyLog = Log(MyAngle Sqr(MyAngle * MyAngle 1))
【Remark】
Natural logarithms are logarithms with e as the base. The value of the constant e is approximately 2.718282.
As shown below, by dividing the natural logarithmic value of x by the natural logarithmic value of n, you can calculate the logarithmic value of the numerical value of x from any bottom n:
Logn(x) = Log(x) / Log(n)
The following example shows how to write a function to find a logarithmic value with a base 10:
Static Function Log10(X)
Log10 = Log(X) / Log(10#)
End Function
【name】
Rnd
【category】
Mathematical functions
【Actoform】
Rnd[(number)]
【parameter】
Required, the number parameter is Single or any valid numeric expression.
【Return Value】
If the value of number is
Rnd Generation
Less than 0
The same result obtained by using number as a random number seed each time.
Greater than 0
The next random number in the sequence.
Equal to 0
The most recent number generated.
Omitted
The next random number in the sequence.
【Exception/Error】
none
【describe】
Returns a Single containing random values. The Rnd function returns a value less than 1 but greater than or equal to 0. The value of number determines how Rnd generates random numbers.
The same sequence is generated for the initially given seed, because each call to the Rnd function uses the previous number in the sequence as the seed of the next number.
Before calling Rnd, the random number generator is initialized using the parameterless Randomize statement, which has the seeds obtained from the system timer.
To generate random integers in a range, the following formula can be used:
Int((upperbound - lowerbound 1) * Rnd lowerbound)
Here, upperbound is the upper limit of the range of random numbers, while lowerbound is the lower limit of the range of random numbers.
Note that if you want to get a repeated random number sequence, call Rnd with negative parameter values directly before using Randomize with numerical parameters. Using Randomize with the same number value will not result in repeated random numbers.
【Example】
This example uses the Rnd function to generate a random integer from 1 to 6 randomly.
Dim MyValue
MyValue = Int((6 * Rnd) 1) ' Generates a random value between 1 and 6.
【Remark】
none
【name】
Sgn
【category】
Mathematical functions
【Actoform】
Sgn(number)
【parameter】
Required, the number parameter is any valid numeric expression
【Return Value】
If number is
Sgn Return
Greater than 0
1
Equal to 0
0
Less than 0
-1
【Exception/Error】
none
【describe】
Returns a Variant (Integer) indicating the positive and negative sign of the parameter. The symbol of the number parameter determines the return value of the Sgn function.
【Example】
This example uses the Sgn function to determine the positive and negative sign of a certain number.
Dim MyVar1, MyVar2, MyVar3, MySign
MyVar1 = 12: MyVar2 = -2.4: MyVar3 = 0
MySign = Sgn(MyVar1) ' Returns 1.
MySign = Sgn(MyVar2) ' Returns -1.
MySign = Sgn(MyVar3) ' Returns 0.
【Remark】
none
【name】
Sin
【category】
Mathematical functions
【Actoform】
Sin(number)
【parameter】
Required, the number parameter is a Double or any valid numeric expression that represents an angle in radians.
【Return Value】
Returns a Double, specifying the sine value of the parameter.
【Exception/Error】
none
【describe】
The Sin function takes an angle as the parameter value and returns the ratio of the opposite side length of the angle divided by the oblique length.
The result has a value range of -1 to 1.
To convert the angle to radians, multiply the angle by pi/180. To convert radians to angles, multiply radians by 180/pi.
【Example】
This example uses the Sin function to find the sine value of an angle (sin()).
Dim MyAngle, MyCosecant
MyAngle = 1.3 ' Define angle (in radians).
MyCosecant = 1 / Sin(MyAngle) ' Use sine to calculate the resection (csc()).
【Remark】
none
【name】
qr
【category】
Mathematical functions
【Actoform】
Sqr(number)
【parameter】
Required, the number parameter is a Double or any valid numeric expression greater than or equal to 0.
【Return Value】
Returns a Double.
【Exception/Error】
none
【describe】
Returns the square root of the specified parameter number
【Example】
This example uses the Sqr function to calculate the square root of a certain number.
Dim MySqr
MySqr = Sqr(4) ' Returns 2.
MySqr = Sqr(23) ' Returns 4.79583152331272.
MySqr = Sqr(0) ' Returns 0.
MySqr = Sqr(-4) ' Generates a runtime error (negative numbers cannot be square rooted with this function).
【Remark】
none
【name】
Tan
【category】
Mathematical functions
【Actoform】
Tan(number)
【parameter】
Required, the number parameter is a Double or any valid numeric expression that represents an angle in radians.
【Return Value】
Returns a Double.
【Exception/Error】
none
【describe】
Returns the tangent value of the specified parameter number. Tan takes an angle as the parameter value and returns the ratio of the two adjacent sides of the right angle. This ratio is the quotient of the opposite side length of the angle divided by the quotient of the adjacent side length of the angle.
To convert the angle to radians, multiply the angle by pi/180/180. To convert radians to angles, multiply radians by 180/pi.
【Example】
This example uses the Tan function to find the tangent of an angle (tan()).
Dim MyAngle, MyCotangent
MyAngle = 1.3 ' Define angle (in radians).
MyCotangent = 1 / Tan(MyAngle) ' Use tangent to calculate cotangent (cot()).
【Remark】
The following is a list of non-basic mathematical functions, all of which can be derived from basic mathematical functions:
function
Formulas derived from basic functions
| The following is the quoted content: Secant (right cut) Sec(X) = 1 / Cos(X) Cosecant Cosec(X) = 1 / Sin(X) Cotangent Cotan(X) = 1 / Tan(X) Inverse Sine Arcsin(X) = Atn(X / Sqr(-X * X 1)) Inverse Cosine Arccos(X) = Atn(-X / Sqr(-X * X 1)) 2 * Atn(1) Inverse Secant (cut anyway) Arcsec(X) = Atn(X / Sqr(X * X - 1)) Sgn((X) - 1) * (2 * Atn(1)) Inverse Cosecant Arccosec(X) = Atn(X / Sqr(X * X - 1)) (Sgn(X) - 1) * (2 * Atn(1)) Inverse Cotangent Arccotan(X) = Atn(X) 2 * Atn(1) Hyperbolic Sine (hyperbolic sine) HSin(X) = (Exp(X) - Exp(-X)) / 2 Hyperbolic Cosine HCos(X) = (Exp(X) Exp(-X)) / 2 Hyperbolic Tangent HTan(X) = (Exp(X) - Exp(-X)) / (Exp(X) Exp(-X)) Hyperbolic Secant (hyperbolic secant) HSec(X) = 2 / (Exp(X) Exp(-X)) Hyperbolic Cosecant HCosec(X) = 2 / (Exp(X) - Exp(-X)) Hyperbolic Cotangent HCotan(X) = (Exp(X) Exp(-X)) / (Exp(X) - Exp(-X)) Inverse Hyperbolic Sine HArcsin(X) = Log(X Sqr(X * X 1)) Inverse Hyperbolic Cosine HArccos(X) = Log(X Sqr(X * X - 1)) Inverse Hyperbolic Tangent HArctan(X) = Log((1 X) / (1 - X)) / 2 Inverse Hyperbolic Secant HArcsec(X) = Log((Sqr(-X * X 1) 1) / X) Inverse Hyperbolic Cosecant HArccosec(X) = Log((Sgn(X) * Sqr(X * X 1) 1) / X) Inverse Hyperbolic Cotangent HArccotan(X) = Log((X 1) / (X - 1)) / 2 Logarithm with base N LogN(X) = Log(X) / Log(N) |
Share: ASP 3.0 Advanced Programming (46) Table 10-5 HTML elements that support data binding can update data. Can table binding be displayed as HTML? A href cannot be APPLET PARAM can be MARAM can be MATTON innerText