473,394 Members | 1,946 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to get the limit on it's range of the double type?

Hi,
I want to write some codes to get the limit of range in real
number.
Could you please give me some sample? Because I am not familiar
with C language.

Thanks,
Viery
Nov 14 '05 #1
3 1396
In 'comp.lang.c', no**********@hotmail.com (Viery) wrote:
I want to write some codes to get the limit of range in real
number.
Could you please give me some sample? Because I am not familiar
with C language.


The values are defined by macros belonging to <float.h>

--
-ed- em**********@noos.fr [remove YOURBRA before answering me]
The C-language FAQ: http://www.eskimo.com/~scs/C-faq/top.html
C-reference: http://www.dinkumware.com/manuals/reader.aspx?lib=cpp
FAQ de f.c.l.c : http://www.isty-info.uvsq.fr/~rumeau/fclc/
Nov 14 '05 #2

"Viery" <no**********@hotmail.com> wrote in message
Hi,
I want to write some codes to get the limit of range in real
number.
Could you please give me some sample?

#include <float.h>
#include <stdio.h>

int main(void)
{
printf("Biggest double %g\n", DBL_MAX);
printf("Smallest fraction %g\n", DBL_MIN);
printf("Decimal precison %d digits\n", (int) DBL_DIG);
return 0;
}
Nov 14 '05 #3
Malcolm wrote:
"Viery" <no**********@hotmail.com> wrote in message
Hi,
I want to write some codes to get the limit of range in real
number.
Could you please give me some sample?


#include <float.h>
#include <stdio.h>

int main(void)
{
printf("Biggest double %g\n", DBL_MAX);
printf("Smallest fraction %g\n", DBL_MIN);
printf("Decimal precison %d digits\n", (int) DBL_DIG);
return 0;
}

Why the cast? DBL_DIG is int.

--
Joe Wright mailto:jo********@comcast.net
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---
Nov 14 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: sandSpiderX | last post by:
Hi, I have to develop a program to compute range of all data types at run time... meaning say char c; now I have to see how many characters char can represent,, one logic i think is to...
9
by: Terry E Dow | last post by:
Howdy, I am having trouble with the objectCategory=group member.Count attribute. I get one of three counts, a number between 1-999, no member (does not contain member property), or 0. Using...
7
by: =?ISO-8859-1?Q?=22=C1lvaro_G=2E_Vicario=22?= | last post by:
I need to emulate the missing "maxlegth" attribute in "textarea" fields but all my Google searches either lead to obsolete scripts that overwrite the "value" property (thus losing caret position)...
7
by: MrHuggykins | last post by:
First Class------------------ // Car class to define all the methods/classes in CarUser public class Car { // Creates object Car public Car() { } // Let's a car have initial gas in the tank
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.