Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Databases
  • SQL
  • MySQL
  • PostgreSQL
  • PL/SQL
  • MongoDB
  • SQL Cheat Sheet
  • SQL Interview Questions
  • MySQL Interview Questions
  • PL/SQL Interview Questions
  • Learn SQL and Database
Open In App
Next Article:
PLSQL | COSH Function
Next article icon

PLSQL | ACOS Function

Last Updated : 06 Oct, 2019
Comments
Improve
Suggest changes
Like Article
Like
Report

The PLSQL ACOS function is used to return the arc cosine of a number. The ACOS function only one parameter which is a number and the argument number must be in the range of -1 to 1, and the function returns a value in the range of 0 to pi, expressed in radians.

This function takes as an argument any numeric data type or any non-numeric data type that can be implicitly converted to a numeric data type.

Syntax:

ACOS( number )

Parameters Used:

number – It is used to specify the number arc cosine needs to be calculated.

Return Value:
The ACOS function in PLSQL returns a numeric value.

Supported Versions of Oracle/PLSQL:

  1. Oracle 12c
  2. Oracle 11g
  3. Oracle 10g
  4. Oracle 9i
  5. Oracle 8i

Example-1: Using a positive numeric value as an argument in the ACOS function.

DECLARE      Test_Number number := 0.5;       BEGIN      dbms_output.put_line(ACOS(Test_Number));        END; 

Output:

1.04719755119659774615421446109316762805 

Example-2: Using a negative numeric value as an argument in the ACOS function.

DECLARE      Test_Number number := -0.5;       BEGIN      dbms_output.put_line(ACOS(Test_Number));        END;  

Output:

2.09439510239319549230842892218633525615 

Example-3: Using a numeric value which doesn’t fall in the range between -1 and 1 as an argument in the ACOS function.

DECLARE      Test_Number number := 4.5;       BEGIN      dbms_output.put_line(ACOS(Test_Number));        END;   

Output:

ERROR  ORA-01428: argument '4.5' is out of range 

The above program throws an error since the argument passed is exceeding the range which can be accepted.

Example-4: Using ACOS function with select query.

SELECT ACOS(.3) FROM dual; 

Output:

0.3046926540153975 

Example-5: Using ACOS function with select query and returning the value in degree.

select (ACOS(.4)) * 57.29  FROM dual; 

Output:

66.41512145087323 

Using the conversion formula of 1 radian = 57.29 degrees.

Advantages:
The ACOS function accepts any numeric datatype or any non-numeric datatype as an argument that can be implicitly converted to a numeric datatype.



Next Article
PLSQL | COSH Function

S

Shubrodeep Banerjee
Improve
Article Tags :
  • SQL
  • SQL-PL/SQL

Similar Reads

  • PLSQL | COS Function
    The PLSQL COS function is used to return the cosine of a numeric value. The COS function accepts one parameter which is the number whose cosine needs to be calculated. The COS function returns a value of the numeric data type. This function takes as an argument any numeric data type as well as any n
    2 min read
  • PLSQL | COSH Function
    The PLSQL COSH function is used to return the hyperbolic cosine of a numeric value. The COSH function accepts one parameter which is the number whose hyperbolic cosine needs to be calculated. The COSH function returns a value of the numeric data type. This function takes as an argument any numeric d
    2 min read
  • PLSQL | ABS Function
    The PLSQL ABS function is used for returning the absolute value of a number. Absolute value is used for depicting the distance of a number on the number line from 0. The direction of the number from zero is not considered since the absolute value of a number is never negative. The ABS in PLSQL funct
    2 min read
  • PLSQL | ASIN Function
    The PLSQL ASIN function is used to return the arc sine of a number. The ASIN function only one parameter which is a number and the argument number must be in the range of -1 to 1, and the function returns a value in the range of -pi/2 to pi/2, expressed in radians. This function takes as an argument
    2 min read
  • PLSQL | ASCII Function
    The string in PL/SQL is actually a sequence of characters with an optional size specification. The characters could be numeric, letters, blank, special characters or a combination of all. The ASCII Function in PLSQL is used to return the NUMBER code that represents the specified character. Syntax AS
    1 min read
  • PLSQL | ATAN Function
    The PLSQL ATAN function is used to return the arc tangent of a number. The ATAN function accepts only one parameter which is a number and the range accepted for the argument number is unbounded. The ATAN function returns a value in the range of -pi/2 to pi/2, expressed in radians. This function take
    2 min read
  • PLSQL | CEIL Function
    The CEIL is an inbuilt function in PLSQL which is used to return the smallest integer value which is either greater than or equal to the given input number. This input number might be in the fraction or in the whole number. Syntax: CEIL(number) Parameters Used: Here the parameter number is the input
    2 min read
  • PLSQL | EXTRACT Function
    The PLSQL EXTRACT function is used for extracting a specific value such as year, month, day or hour from a date or an interval value. Syntax: EXTRACT(field FROM source) Parameters Used: The EXTRACT function accepts two parameters : field - It is used to specify the component that needs to be extract
    2 min read
  • PLSQL | FLOOR Function
    The FLOOR is an inbuilt function in PLSQL which is used to return the largest integer value which will be either equal to or less than from a given input number. Syntax: FLOOR(number) Parameters Used: This function accepts a parameter number which is the input number on which FLOOR function is calle
    2 min read
  • PLSQL | ATAN2 Function
    The PLSQL ATAN2 function is used to return the arc tangent of n and m. The ATAN2 function is generally used if you want to convert cartesian coordinates to polar coordinates. The ATAN2 function accepts two parameters which are numbers and the range accepted by the argument n is unbounded. The ATAN2
    2 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences