COS¶
The COS function is used to calculate the cosine of a number. It takes a single numeric argument (angle in radians) and returns the cosine of that angle.
Syntax¶
value: A numeric expression (angle in radians) for which the cosine is to be calculated.
Examples¶
Let's consider a table named SingleItem with the following schema:
Insert a row into the SingleItem table:
Example 1: Using COS with float values¶
Result:
Example 2: Using COS with NULL values¶
Result:
Errors¶
The COS function requires a numeric value as its argument. Using non-numeric values or more than one argument will result in an error.
Example 3: Using COS with non-numeric values¶
Error: Function requires a numeric value.
Example 4: Using COS with multiple arguments¶
Error: Function expects 1 argument, but 2 were provided.