- 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
Difference between float and double in Arduino
Float
- Floating point numbers are stored using 4 bytes (32 bits).
- Their max value can be 3.4028235E+38 and their min value can be -3.4028235E+38.
- They have a precision of about 6-7 decimal places.
Double
- While on several platforms, double has more precision than float. However, on most Arduino boards (Uno and many other ATmega boards), double has the same size as float. Arduino Due is an exception, wherein double has a size of 8 bytes (compared to 4 bytes of float).
- On the boards where double is stored using 8 bytes, the max value can be 1.7*10^308 and the min value can be -1.7*10^308. On the boards where double is stored using 4 bytes, the max and min values are equivalent to float.
- For the boards where double is stored using 8 bytes, the decimal precision is 14-15 places.
- Related Articles
- Difference Between Float and Double
- Difference between float and double in C/C++
- What is the difference between a float, double and a decimal in C#?
- Float and Double in C
- Round float and double numbers in Java
- Difference between #define and const in Arduino
- How to compare float and double in C++?
- Difference between signed and unsigned integer in Arduino
- Comparison of double and float primitive types in C#
- Difference between hardware serial and software serial in Arduino
- Difference between single quote (‘) and double quote (“) in PowerShell?
- Convert string to integer/ float in Arduino
- Difference between Single Action and Double Action Guns
- Comparison of double and float primitive types in Java\n
- Difference between Single-Cage and Double-Cage Induction Motors

Advertisements