long double
We can use a long modifier with double datatype to create a long double variable. Long double is used to store significantly large decimal numbers which surpass the range of double.
- The size of a long double is 16 bytes.
- It provides more accuracy, precision and a larger range than the standard double data type.
- The format specifier for long double is %Llf.
Syntax of long double
long double var;
Example of long double
C
// C program to illustrate the long long int #include <stdio.h> int main() { // declaring the long long int variable long double var; // printing the size of long double printf ( "Size of long double: %d" , sizeof ( long double )); return 0; } |
Output
Size of long double: 16
C Long
In C, the long keyword is a datatype modifier that can be applied to the basic datatypes to increase the range and size of values their variables can store. For example, a long int variable can store integer values that range from -2,147,483,648 to 2,147,483,647 which is significantly greater as compared to the normal int data type, which can store integer values that range from -32,768 to 32,767 in the 16-bit compiler.
Contact Us