- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Exponential expressions in Arduino
The pow() function of Arduino can be used for evaluating exponential expressions. Any expression of the form ab can be expressed as pow(a,b). For example 23 becomes pow(2,3).
The type for both the base (a) and the exponent (b) is float. This function returns a double.
Example
void setup() { // put your setup code here, to run once: Serial.begin(9600); Serial.println(); float base = 2; float exponent = 3; Serial.println(pow(base,exponent)); } void loop() { // put your main code here, to run repeatedly: }
Output
The Serial Monitor Output is shown below −
You are encouraged to try different values of base and exponent and check the working of this function.
- Related Articles
- Trigonometric expressions in Arduino
- Difference Between Exponential Growth and Exponential Decay
- Exponential Search
- Laplace Transform of Real Exponential and Complex Exponential Functions
- Arduino Uno vs Arduino Leonardo
- Arduino Uno vs Arduino Micro
- Arduino Uno vs Arduino Mega
- Arduino Uno vs Arduino Nano
- Arduino Uno vs Arduino Due
- Interrupts in Arduino
- Arrays in Arduino
- PWM in Arduino
- Timers in Arduino
- LinkedList in Arduino
- Goto in Arduino

Advertisements