Cosine function.

**X**- must be of type real or complex.

**Class**

Elemental function

**Result Type and Attributes**

Same as X.

**Result Value**

- It has a value that approximates cos(X).
- If X is of type real, X is regarded as a value in radians.
- If X is of type complex, the real part of X is regarded as a value in radians.

**Examples**

COS (1.0) has the value 0.54030231 (approximately).

Specific Name | Argument Type | Result Type | Pass As Arg? |
---|---|---|---|

COS | default real | default real | yes |

DCOS | double precision real | double precision real | yes |

QCOS (1)
| REAL(16) | REAL(16) | yes |

CCOS (2a)
| default complex | default complex | yes |

CDCOS (1) (2b)
| double complex | double complex | yes |

ZCOS (1) (2b)
| double complex | double complex | yes |

CQCOS (1) (2b)
| COMPLEX(16) | COMPLEX(16) | yes |

**Notes: **

- IBM Extension.
- Given that X is a complex number in the form a + bi, where
i = (-1)
^{½:}- abs(b) must be less than or equal to 88.7228; a is any real value.
- abs(b) must be less than or equal to 709.7827; a is any real value.

- Given that X is a complex number in the form a + bi, where
i = (-1)
^{½},