assign infinity ?!
-
infinity is not a number, so you can't! you can just use very big values using custom libraries for very big numbers. Don't try it, just do it! ;-)
-
Since infinity doesn't exist (i.e., there's always one more number after the biggest number you can think of), how can you assign it to a variable? You can, however, assign a maximum value to integral types like:
int i = INT_MAX;
char c = CHAR_MAX;
unsigned long ul = ULONG_MAX;
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
-
It's easy, just use the infinity symbol. If you can't find it, take your keyboard back and demand a replacement. Christian I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
-
It's easy, just use the infinity symbol. If you can't find it, take your keyboard back and demand a replacement. Christian I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
Brilliant!! :) Don't try it, just do it! ;-)
-
It depends. If you value is a
float
ordouble
, then it may be possible, take a look at:numeric_limits::infinity()
If your variable is an int, long or anything like that, then it is NOT possible to do - no matter what you set the value to, you can add to it and change it. (Although if it goes beyond the maximum value it can hold it will wrap around to a really big negative number!) Now, if you want to know how to create an infinite loop, I've done that many times before... :-D Remember, even if you win the rat race, you're still a rat. -
It's easy, just use the infinity symbol. If you can't find it, take your keyboard back and demand a replacement. Christian I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
:laugh::laugh::laugh: Where is the any key? INTP
-
It depends. If you value is a
float
ordouble
, then it may be possible, take a look at:numeric_limits::infinity()
If your variable is an int, long or anything like that, then it is NOT possible to do - no matter what you set the value to, you can add to it and change it. (Although if it goes beyond the maximum value it can hold it will wrap around to a really big negative number!) Now, if you want to know how to create an infinite loop, I've done that many times before... :-D Remember, even if you win the rat race, you're still a rat.Navin wrote: if you want to know how to create an infinite loop, I've done that many times before... :-D Maxwell Chen
-
Wouldn't assigning infinity to a number require an infinite amount of time? If you every figure it out, I'll be glad to test for a small hourly wage ;) The maximum characters for the signature is five hundred. I was wondering how long a five hundred characters message would be, so I decided to make my signature 500 characters long. I'm sure if I had some cool html stuff in my signature, I could eat up five hundred characters, but just typing five hundred characters takes quite some time. The trick I think is finding something to say, but I'm usually a man of few words. So I guess I'll tell you what I've discovered is the secret to life. It