C Programming - Floating Point Issues - Discussion
Discussion Forum : Floating Point Issues - General Questions (Q.No. 4)
4.
Which of the following range is a valid long double (Turbo C in 16 bit DOS OS) ?
Answer: Option
Explanation:
The range of long double is 3.4E-4932 to 1.1E+4932
Discussion:
17 comments Page 1 of 2.
Nakul said:
8 years ago
Can anyone explain it properly?
(1)
Pawan said:
1 decade ago
According to "Let us C" it is -1.7e4932 to 1.7e4932.
So please tell me which one is correct?
So please tell me which one is correct?
(1)
Sundar said:
1 decade ago
long double (80 bits or 10 bytes) : 3.4 * (10^-4932) to 1.1 * (10^+4932)
In Turbo C: (16 bit DOS Operating system).
#include<stdio.h>
int main()
{
printf("long double size = %d", sizeof(long double));
return 0;
}
Output: 10
If you execute the same in IndiaBIX's Online compiler (32 bit Linux OS), the output will be 12.
In Turbo C: (16 bit DOS Operating system).
#include<stdio.h>
int main()
{
printf("long double size = %d", sizeof(long double));
return 0;
}
Output: 10
If you execute the same in IndiaBIX's Online compiler (32 bit Linux OS), the output will be 12.
Shivam said:
5 years ago
I think. -1.7e4932 is the right answer.
Shivam said:
9 years ago
What is E stands for?
Purni said:
9 years ago
The long double default range is same as the the double from 1.7E-308 to 1.7E+308.
But the long double data type is system(Processor, ABI, compiler)dependent and so its range varies accordingly.
You can also check the long double range with the function std::numeric_limits<long double>::min and std::numeric_limits<long double>::max.
But the long double data type is system(Processor, ABI, compiler)dependent and so its range varies accordingly.
You can also check the long double range with the function std::numeric_limits<long double>::min and std::numeric_limits<long double>::max.
Ishaan said:
10 years ago
Can someone explain how it comes 80 bits?
Is their any logic to find the value?
Long means 4 bytes.
Double means 8 bytes.
How long double 10 bytes?
Is their any logic to find the value?
Long means 4 bytes.
Double means 8 bytes.
How long double 10 bytes?
Parag said:
1 decade ago
I too think that it is -1.7e4932 to +1.7e4932.
Geetha said:
1 decade ago
If the OS different means the range of the datatype is also different?
Ritesh_IIIT said:
1 decade ago
@Sundar.
Yes friend you are absolutely correct but in books long double range is given as -1.7e4932 to +1.7e4932 and of the size of 10 bytes with format specifier as %Lf.
Yes friend you are absolutely correct but in books long double range is given as -1.7e4932 to +1.7e4932 and of the size of 10 bytes with format specifier as %Lf.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers