C# | Math.Pow() Method - GeeksforGeeks
- Courses
- DSA to Development
- Machine Learning & Data Science
- Generative AI & ChatGPT
- Become AWS Certified
- DSA Courses
- Data Structure & Algorithm(C++/JAVA)
- Data Structure & Algorithm(Python)
- Data Structure & Algorithm(JavaScript)
- Programming Languages
- CPP
- Java
- Python
- JavaScript
- C
- All Courses
- Tutorials
- Python Tutorial
- Taking Input in Python
- Python Operators
- Python Data Types
- Python Loops and Control Flow
- Python Conditional Statements
- Python Loops
- Python Functions
- Python OOPS Concept
- Python Data Structures
- Python Exception Handling
- Python File Handling
- Python Exercises
- Java
- Learn Java Programming Language
- Java Collections
- Java 8 Tutorial
- Java Programs
- Java Interview Questions
- Java Interview Questions
- Core Java Interview Questions-Freshers
- Java Multithreading Interview Questions
- OOPs Interview Questions and Answers
- Java Exercises
- Java Quiz
- Java Quiz
- Core Java MCQ
- Java Projects
- Advance Java
- Spring Tutorial
- Spring Boot Tutorial
- Spring Boot Interview Questions
- Spring MVC Tutorial
- Spring MVC Interview Questions
- Hibernate Tutorial
- Hibernate Interview Questions
- Programming Languages
- JavaScript
- C++
- R Tutorial
- SQL
- PHP
- C#
- C
- Scala
- Perl
- Go Language
- Kotlin
- System Design
- System Design Tutorial
- Software Design Patterns
- System Design Roadmap
- Top 10 System Design Interview Questions and Answers
- Interview Corner
- Company Preparation
- Top Topics
- Practice Company Questions
- Interview Experiences
- Experienced Interviews
- Internship Interviews
- Competitive Programming
- Multiple Choice Quizzes
- Aptitude for Placements
- Computer Science Subjects
- Operating System
- DBMS
- Computer Networks
- Engineering Mathematics
- Computer Organization and Architecture
- Theory of Computation
- Compiler Design
- Digital Logic
- Software Engineering
- DevOps
- GIT
- AWS
- Docker
- Kubernetes
- Microsoft Azure Tutorial
- Google Cloud Platform
- Linux
- Linux Tutorial
- Linux Commands A-Z
- Linux Commands Cheatsheet
- File Permission Commands
- Linux System Administration
- Linux File System
- Linux Shell Scripting
- Linux Networking
- Linux Interview Questions
- Software Testing
- Software Testing Tutorial
- Software Engineering Tutorial
- Testing Interview Questions
- Jira
- Databases
- DBMS Tutorial
- SQL Tutorial
- PostgreSQL Tutorial
- MongoDB Tutorial
- SQL Interview Questions
- MySQL Interview Questions
- PL/SQL Interview Questions
- Android
- Android Tutorial
- Android Studio Tutorial
- Kotlin For Android
- Android Projects
- Android Interview Questions
- 6 Weeks of Android App Development
- Excel
- MS Excel Tutorial
- Introduction to MS Excel
- Data Analysis in Excel
- Basic Excel Formulas & Functions
- Data Analysis in Advanced Excel
- Workbooks
- Statistical Functions
- Data Visualization in Excel
- Pivot Tables in Excel
- Excel Spreadsheets in Python
- Basic Excel Shortcuts
- Mathematics
- Number System
- Algebra
- Linear Algebra
- Trigonometry
- Set Theory
- Statistics
- Probability
- Geometry
- Mensuration
- Logarithms
- Calculus
- Python Tutorial
- DSA
- Data Structures
- Arrays
- Matrix
- Strings
- Linked List
- Stack
- Queue
- Tree
- Heap
- Hashing
- Graph
- Set Data Structure
- Map Data Structure
- Advanced Data Structure
- Data Structures Tutorial
- Algorithms
- Analysis of Algorithms
- Design and Analysis of Algorithms
- Asymptotic Analysis
- Asymptotic Notations
- Worst, Average and Best Cases
- Searching Algorithms
- Linear Search
- Binary Search
- Searching Algorithms Tutorial
- Sorting Algorithms
- Selection Sort
- Bubble Sort
- Insertion Sort
- Merge Sort
- Quick Sort
- Heap Sort
- Counting Sort
- Radix Sort
- Bucket Sort
- Sorting Algorithms Tutorial
- Greedy Algorithms
- Dynamic Programming
- Graph Algorithms
- Pattern Searching
- Recursion
- Backtracking
- Divide and Conquer
- Mathematical Algorithms
- Geometric Algorithms
- Bitwise Algorithms
- Randomized Algorithms
- Branch and Bound
- Algorithms Tutorial
- Analysis of Algorithms
- DSA Tutorial
- Practice
- All DSA Problems
- Problem of the Day
- Company Wise Coding Practice
- Amazon
- Microsoft
- Flipkart
- Explore All
- GfG SDE Sheet
- Practice Problems Difficulty Wise
- School
- Basic
- Easy
- Medium
- Hard
- Language Wise Coding Practice
- CPP
- Java
- Python
- Curated DSA Lists
- Beginner's DSA Sheet
- Top 50 Array Problems
- Top 50 String Problems
- Top 50 DP Problems
- Top 50 Graph Problems
- Top 50 Tree Problems
- Competitive Programming
- Company Wise SDE Sheets
- Facebook SDE Sheet
- Amazon SDE Sheet
- Apple SDE Sheet
- Netflix SDE Sheet
- Google SDE Sheet
- DSA Cheat Sheets
- SDE Sheet
- DSA Sheet for Beginners
- FAANG Coding Sheet
- Product-Based Coding Sheet
- Company-Wise Preparation Sheet
- Top Interview Questions
- Puzzles
- All Puzzles
- Top 100 Puzzles Asked In Interviews
- Top 20 Puzzles Commonly Asked During SDE Interviews
- Data Structures
- Data Science
- Python Tutorial
- R Tutorial
- Machine Learning
- Data Science using Python
- Data Science using R
- Data Science Packages
- Pandas Tutorial
- NumPy Tutorial
- Data Visualization
- Python Data Visualization Tutorial
- Data Visualization with R
- Data Analysis
- Data Analysis with Python
- Data Analysis with R
- Deep Learning
- NLP Tutorial
- Web Tech
- HTML Tutorial
- CSS Tutorial
- JavaScript Tutorial
- PHP Tutorial
- ReactJS Tutorial
- NodeJS Tutorial
- Bootstrap Tutorial
- Typescript
- Web Development Using Python
- Django
- Django Tutorial
- Django Projects
- Django Interview Questions
- Flask
- Flask Tutorial
- Flask Projects
- Flask Interview Questions
- Postman
- Github
- Django
- Cheat Sheets
- HTML Cheat Sheet
- CSS Cheat Sheet
- JavaScript Cheat Sheet
- React Cheat Sheet
- Angular Cheat Sheet
- jQuery Cheat Sheet
- Bootstrap Cheat Sheet
- Learn Complete Web Development
- .NET Framework
- C# Data Types
- C# Keywords
- C# Decision Making
- C# Methods
- C# Delegates
- C# Constructors
- C# Arrays
- C# ArrayList
- C# String
- C# Tuple
- C# Indexers
- C# Interface
- C# Multithreading
- C# Exception
In C#, Math.Pow() is a Math class method. This method is used to calculate a number raise to the power of some other number.
Syntax:
public static double Pow(double base, double power)Parameters:
double base: It is a double-precision floating-point number which is to be raised to a power and type of this parameter is System.Double.
double power: It is a double-precision floating-point number which specifies a power or exponent and type of this parameter is System.Double.
Return Type: The function returns the number base raised to the power. The type of this method is System.Double
Examples:
Input : base = 8, power =2 Output : 64 Input : base = 2.5, power =3 Output : 15.625Program: To demonstrate the Math.Pow()
// C# program to illustrate the // Math.Pow() function using System; class GFG { // Main Method static public void Main() { // Find power using Math.Pow // 6 is base and 2 is power or // index or exponent of a number double pow_ab = Math.Pow(6, 2); // Print the result Console.WriteLine(pow_ab); // 3.5 is base and 3 is power or // index or exponent of a number double pow_tt = Math.Pow(3.5, 3); // Print the result Console.WriteLine(pow_tt); // 202 is base and 4 is power or // index or exponent of a number double pow_t = Math.Pow(202, 4); // Print the result Console.WriteLine(pow_t); } } |
Output:
36 42.875 1664966416Reference: https://msdn.microsoft.com/en-us/library/system.math.pow(v=vs.110).aspx
Comment More info Next Article C# | Math.Sqrt() Method jit_t Follow ImproveSimilar Reads
- C# | Math.Pow() Method In C#, Math.Pow() is a Math class method. This method is used to calculate a number raise to the power of some other number. Syntax: public static double Pow(double base, double power) Parameters: double base: It is a double-precision floating-point number which is to be raised to a power and type o 2 min read
- C# | Math.Sqrt() Method In C#, Math.Sqrt() is a Math class method which is used to calculate the square root of the specified number. Sqrt is a slower computation. It can be cached for a performance boost. Syntax: public static double Sqrt(double d) Parameter: d: Number whose square root is to be calculated and type of thi 3 min read
- C# | Math.Exp() Method In C#, Exp() is a Math class method which is used to return the e raised to the specified power. Here e is a mathematical constant whose value is approximately 2.71828. Exp() is the inverse of Log(). Syntax: public static double Exp (double num); Parameter: num: It is the required number of type Sys 2 min read
- C# | Math.Log() Method In C#, Math.Log() is a Math class method. It is used to return the logarithm of a specified number. This method can be overloaded by changing the number of the arguments passed. There are total 2 methods in the overload list of the Math.Log() method as follows: Math.Log(Double) Method Math.Log(Doubl 4 min read
- C# | Math.Log10() Method In C#, Math.Log10() is a Math class method. It is used to return the base 10 logarithm of a specified number. Syntax: public static double Log10(double val) Parameter: val: It is the specified number whose logarithm to be calculated and its type is System.Double. Return Value: It returns the logarit 2 min read
- C# | Math.BigMul() Method In C#, BigMul() is a method class method. This method is used to compute the full product of two 32-bit numbers.Syntax: public static long BigMul(int a, int b) Parameters: a: It is the first number to be multiplied and the type of this parameter is System.Int32. b: It is the Second number to be mult 1 min read
- MathF.Pow() Method in C# with Examples In C#, MathF.Pow(Single, Single) is a MathF class method. This method is used to calculate a number raise to the power of some other number. Syntax: public static float Pow (float x, float y); Parameters: x: It is a single-precision floating-point number which is to be raised to a power and type of 2 min read
- MathF.Exp() Method in C# with Examples In C#, Exp(Single) is a MathF class method which is used to return the e raised to the specified power. Here e is a mathematical constant whose value is approximately 2.71828. Syntax: public static float Exp (float x); Here, x is the required number of type System.Single which specifies a power. Ret 1 min read
- MathF.Log() Method in C# with Examples In C#, MathF.Log() is a MathF class method. It is used to return the logarithm of a specified number. This method can be overloaded by changing the number of the arguments passed. There are total 2 methods in the overload list of the MathF.Log() method as follows: MathF.Log(Single) Method MathF.Log( 4 min read
- C# | Math Class Fields with Examples In C#, the Math class provides the constants and the static methods for logarithmic, trigonometric, and other mathematical functions. Math class has two fields as follows: Math.E FieldMath.PI FieldMath.E Field This field represents the natural logarithmic base, specified by the constant, e. Syntax: 3 min read
- Power of a Number in C In this article, we will learn how to write a C program to calculate the power of a number (xn). We may assume that x and n are small and overflow doesn't happen. C Program To Calculate the Power of a Number A simple solution to calculate the power would be to multiply x exactly n times. We can do t 2 min read
- Factorial Program in C Write a C program to find the factorial of the given number. A factorial is the product of all the natural numbers less than or equal to the given number N. Examples Input: N = 5Output: 120Explanation: 5! = 5 × 4 × 3 × 2 × 1 = 120 Input: N = 0Output: 1Explanation: 0! = 1 by definition Different Ways 4 min read
- cbrt() Function in C cbrt() function in C is a predefined function in the math.h library used to calculate the cube root of a given number. To use this function, we must include the <math.h> header file in our program. It returns the cube root of the number as a double and works with double data types. For other d 3 min read
- C log() Function log() function in C programming is a mathematical function provided by the math.h header file and is used to calculate the natural logarithm (base(e)) of a given number passed as parameter. This function returns natural logarithm of x as double and works with double data types for other data types l 3 min read
- C Program to Multiply two Floating Point Numbers Floating point numbers are a way to represent real numbers with both whole parts and fractional parts. In this article, we will learn how to write a C program to find the product of two floating-point numbers. The below image shows an example of floating point multiplication in C: C Program To Multi 1 min read
- C program to Count the digits of a number Given a number N, write a C program to find the count of digits in the number N. Examples: Input: N = 12345 Output: 5 Explanation: The count of digit in 12345 = 5 Input: N = 23451452 Output: 8 Explanation: The count of digits in 23451452 = 8Methods to Count Digits of a NumberThere are a few methods 4 min read
- ilogb() Function in C The ilogb() function in C is a part of the standard math library <math.h>. It is used to compute the binary exponent of a floating-point number, which is the exponent of the value when represented as a normalized floating-point number. This function is particularly useful for numerical analysi 3 min read
- C Program For Octal to Decimal Conversion The number system is one of the ways to represent numbers. Every number system has its own base or radix. For example, Binary, Octal, Decimal, and Hexadecimal Number systems are some of the number systems and are also used in microprocessor programming. These numbers are easy to convert from one sys 3 min read
- Convert Binary to Decimal in C In this article, we will learn how to write a C program to convert the given binary number into an equivalent decimal number. Binary numbers are expressed in base 2 ( 0, 1 ) and decimal numbers are expressed in base 10 ( 0-9 ). Algorithm to Convert Binary Numbers to DecimalThe idea is to extract the 2 min read
- Convert Decimal to Binary in C In this article, we will learn to write a C program to convert a decimal number into a binary number. The decimal number system uses ten digits from 0 to 9 to represent numbers and the binary number system is a base-2 number system that uses only 0 and 1 to represent numbers. Algorithm to Convert De 2 min read
- C#
- CSharp-Math
- CSharp-method
What kind of Experience do you want to share?
Interview Experiences Admission Experiences Career Journeys Work Experiences Campus Experiences Competitive Exam ExperiencesTừ khóa » C# 2 Hoch N
-
Math.Pow(Double, Double) Method (System) - Microsoft Docs
-
Is There An Exponent Operator In C#? - Stack Overflow
-
JavaScript Math Pow() Method - W3Schools
-
Exponent In C# | Delft Stack
-
Scripting API: Mathf.Pow - Unity - Manual
-
Hochzahlen In C#
-
Wie Schreibe Ich 10^-3? - Narkive
-
Potenzbutton Mit C#? Potenzen Rechnen Mit C - Gutefrage
-
Cách Tính Giai Thừa Của Một Số Trong C#
-
Vòng Lặp For Trong C#. | How Kteam
-
Kotlin Program To Calculate The Power Of A Number - Programiz
-
SQL POWER() Function - W3resource
-
Zweierpotenz (Power Of Two) - TRAIN Your Programmer