Oracle COSH Function: A Simple Guide

The COSH function in Oracle SQL is a mathematical function that returns the hyperbolic cosine of a given number.

This is a technical function used in engineering, physics, and complex mathematics, rather than in typical business reporting.

What is the COSH Function in Oracle?

The COSH (Hyperbolic Cosine) function takes a single number as input and returns its hyperbolic cosine. Unlike the regular COS function, COSH is not periodic (it doesn't repeat in a wave).

  • Input: A number.
  • Output: The hyperbolic cosine of that number.

COSH Function Syntax

The syntax for COSH is very simple:

COSH(n)

Let's break that down:

  • n: The number for which you want to find the hyperbolic cosine.

Oracle COSH Function Examples

Here are two practical examples of how to use COSH.

Example 1: Finding the Hyperbolic Cosine of 0 with COSH

This example finds the hyperbolic cosine of 0, which is a standard mathematical identity. The result is always 1.

Query:

SELECT 
  COSH(0) AS "Cosh_of_0"
FROM DUAL;

Result:

 Cosh_of_0
-----------
          1

Example 2: Using COSH Finding the Hyperbolic Cosine of 1

This example calculates the hyperbolic cosine of the number 1.

Query:

SELECT 
  COSH(1) AS "Cosh_of_1"
FROM DUAL;

Result:

 Cosh_of_1
-----------
 1.54308063

Get more Vinish.dev tutorials on Google

See my articles more often when you search Google.

Vinish Kapoor
Vinish Kapoor

An Oracle ACE, author of four books on Oracle APEX, SQL and PL/SQL, and Oracle Forms, and a software developer building Oracle database applications since 2001.

guest

0 Comments
Oldest
Newest Most Voted