-
September 24th, 2002, 05:49 AM
#1
Member
A question about C laguage
Could anyone give me a hint to write a program that prints the smallest and the largest double value available on the system that the program is running on?
I mean by using c language! thanks
I\'d found my best love, but I didn\'t treasure her. I felt regretful after that. It\'s the ultimate pain in the world. If God can give me a chance, I will tell her three word: \"I love you\". If God wanna give me a time limit, I\'ll say this love will last 10 thousand years!
-
September 24th, 2002, 05:56 AM
#2
AFAIK it is the same for all OS types, and is strictly a C thing:
2.2E-308 to 1.8E308
Where E is X 10 raised to the power...
http://bwilkins.panola.cc.tx.us/COSC...&Constants.htm
EDIT: I tryed to print the range, I can print 2.2E-308 but for some reason I get infinity for 1.8E308
It might be one of C's limitation,
double x = 2.2E-308,y = 1.8E308;
cout << "double ranges from " << (double) x << " to " << (double) y << endl;
system("PAUSE");
double ranges from 2.2e-308 to infinity
Press any key to continue...
-
September 24th, 2002, 06:36 AM
#3
That's usually specified in limits.h
Ammo
Credit travels up, blame travels down -- The Boss
-
September 25th, 2002, 08:24 PM
#4
Member
wouldn't that have an issue with the word size? I.E.(as my post got answered before), a 64 bit word has a 1 bit sign, an 11 digit exponent, and a 35 bit mantissa.
-
September 27th, 2002, 03:13 AM
#5
Member
I made some code:
what do you think?
anyone know how to copy some words from my own file to this website under Linux?
I\'d found my best love, but I didn\'t treasure her. I felt regretful after that. It\'s the ultimate pain in the world. If God can give me a chance, I will tell her three word: \"I love you\". If God wanna give me a time limit, I\'ll say this love will last 10 thousand years!
-
September 27th, 2002, 07:43 AM
#6
you click in your text with the left mouse button at the start of the line you want to coppy.
keep the left button down and selelect the text..
release the left mouse button..
move your mouse to the input box below... and click your middle mouse button..
that's all.
ASCII stupid question, get a stupid ANSI.
When in Russia, pet a PETSCII.
Get your ass over to SLAYRadio the best station for C64 Remixes !
-
September 27th, 2002, 02:35 PM
#7
Senior Member
The limits are defined in limits.h.Try help on the header.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|