Delphi includes a number of math functions in its standard library, which you can use by including the Math unit in your program and calling the functions as needed. For example
1 2 3 4 5 6 7 8 |
uses Math; var x, y: Double; begin x := Cos(0.5); y := Exp(2.7); end; |
Here are some of the math functions that are available in the Math unit
- Abs Returns the absolute value of a number.
- ArcTan Returns the arc tangent of a number.
- Cos Returns the cosine of an angle.
- Exp Returns the exponential value of a number.
- Ln Returns the natural logarithm of a number.
- Round Rounds a number to the nearest integer.
- Sin Returns the sine of an angle.
- Sqrt Returns the square root of a number.
You can find more information about these functions and others in the Delphi documentation.
Leave a Reply