Comparing InfinityHow do you check for infinite and indeterminate values in C++?Why does comparing strings using either '==' or 'is' sometimes produce a different result?Python Infinity - Any caveats?Creating complex infinity with std::complex<T> in C++Is it safe to sort a container which may contain infinities using quicksort?implementation of isnan() functionrepresenting infinity and NAN independent of implementationC++ factorial program give infinity for any number greater than 2Can a double be greater than itself?Equivalent of numpy.nan_to_num in C/C++
Why was "leaping into the river" a valid trial outcome to prove one's innocence?
How much power do LED smart bulb wireless control systems consume when the light is turned off?
Do Milankovitch Cycles fully explain climate change?
Is there any detail about ambulances in Star Wars?
Job offer without any details but asking me to withdraw other applications - is it normal?
Can a magnet rip protons from a nucleus?
How does Vivi differ from other Black Mages?
Ambiguous behaviour in casting
Why does F + F' = 1?
Why is the Tm defined as the temperature at which 50% of dsDNA has changed into ssDNA?
How do I restrict an interpolated function to only take values > 0?
What is going on: C++ std::move on std::shared_ptr increases use_count?
What is this sticking out of my wall?
How can I protect myself in case of a human attack like the murders of the hikers Jespersen and Ueland in Morocco?
On the origin of "casa"
Is English tonal for some words, like "permit"?
How can "life" insurance prevent the cheapening of death?
2.5 year old daughter refuses to take medicine
Which ping implementation is cygwin using?
Why is xterm installed when trying to uninstall gnome-terminal?
Could the government trigger by-elections to regain a majority?
Methods and Feasibility of Antimatter Mining?
Why should I always enable compiler warnings?
Are programming languages necessary/useful for operations research practitioner?
Comparing Infinity
How do you check for infinite and indeterminate values in C++?Why does comparing strings using either '==' or 'is' sometimes produce a different result?Python Infinity - Any caveats?Creating complex infinity with std::complex<T> in C++Is it safe to sort a container which may contain infinities using quicksort?implementation of isnan() functionrepresenting infinity and NAN independent of implementationC++ factorial program give infinity for any number greater than 2Can a double be greater than itself?Equivalent of numpy.nan_to_num in C/C++
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
While looking for infinity value, I found out that:
In case of Python 3.7, INFINITY > INFINITY - 1 returns False and returns same if we do INFINITY < INFINITY - 1.
In case of C++ also, I get the same result that is False.
Is this happening because we don't have a proper definition for INFINITY? Right now we just know that it's just a huge number and we can not say that INFINITY starts after some specific number 'X'.
Coming back to the problem:
Now, some number x is obviously greater than x-1. Why this is not case with INFINITY?
Python Code:
A = float('inf')
B = float('inf')
print(A > B-1) # returns False
print(A < B-1) # returns False
C++ Code:
#include <iostream>
#include <limits>
using namespace std;
int main()
double a = numeric_limits<double>::infinity();
double b = numeric_limits<double>::infinity();
if (a>(b-1))cout<<"TRUE";
else cout<<"FALSE"<<endl; //returns else part- FALSE
if (a<(b-1))cout<<"TRUE";
else cout<<"FALSE"; //returns else part- FALSE
return 0;
For any other number = 10, number > number - 1 will return True and number < number - 1 will return False.
python c++ infinity
|
show 6 more comments
While looking for infinity value, I found out that:
In case of Python 3.7, INFINITY > INFINITY - 1 returns False and returns same if we do INFINITY < INFINITY - 1.
In case of C++ also, I get the same result that is False.
Is this happening because we don't have a proper definition for INFINITY? Right now we just know that it's just a huge number and we can not say that INFINITY starts after some specific number 'X'.
Coming back to the problem:
Now, some number x is obviously greater than x-1. Why this is not case with INFINITY?
Python Code:
A = float('inf')
B = float('inf')
print(A > B-1) # returns False
print(A < B-1) # returns False
C++ Code:
#include <iostream>
#include <limits>
using namespace std;
int main()
double a = numeric_limits<double>::infinity();
double b = numeric_limits<double>::infinity();
if (a>(b-1))cout<<"TRUE";
else cout<<"FALSE"<<endl; //returns else part- FALSE
if (a<(b-1))cout<<"TRUE";
else cout<<"FALSE"; //returns else part- FALSE
return 0;
For any other number = 10, number > number - 1 will return True and number < number - 1 will return False.
python c++ infinity
1
Are you asking about the concept of infinity in math or are you asking how infinity is represented on a computer?
– AchimGuetlein
Mar 28 at 7:26
how the infinity is represented on a computer?
– Sumedh Junghare
Mar 28 at 7:34
2
In mathematics,infinity - 1is stillinfinity. So what? So ifa = infinity,b = infinity - 1, anda == bis true, obviouslya > bis false.
– fferri
Mar 28 at 7:38
@fferri: what mathematics is that? Over real numbers,x - 1never equalsx. Find me a definition of a mathematical infinity as a value and you'll find it's not something you find in real/complex math. And python/c++ standard libraries don't really cater to hyperreal numbers where you might find such things defined...
– souser12345
Mar 28 at 7:39
1
@souser12345 infinity is not a real number... ofteninfis defined asinf > xfor allxinN(natural numbers)...
– hiro protagonist
Mar 28 at 7:42
|
show 6 more comments
While looking for infinity value, I found out that:
In case of Python 3.7, INFINITY > INFINITY - 1 returns False and returns same if we do INFINITY < INFINITY - 1.
In case of C++ also, I get the same result that is False.
Is this happening because we don't have a proper definition for INFINITY? Right now we just know that it's just a huge number and we can not say that INFINITY starts after some specific number 'X'.
Coming back to the problem:
Now, some number x is obviously greater than x-1. Why this is not case with INFINITY?
Python Code:
A = float('inf')
B = float('inf')
print(A > B-1) # returns False
print(A < B-1) # returns False
C++ Code:
#include <iostream>
#include <limits>
using namespace std;
int main()
double a = numeric_limits<double>::infinity();
double b = numeric_limits<double>::infinity();
if (a>(b-1))cout<<"TRUE";
else cout<<"FALSE"<<endl; //returns else part- FALSE
if (a<(b-1))cout<<"TRUE";
else cout<<"FALSE"; //returns else part- FALSE
return 0;
For any other number = 10, number > number - 1 will return True and number < number - 1 will return False.
python c++ infinity
While looking for infinity value, I found out that:
In case of Python 3.7, INFINITY > INFINITY - 1 returns False and returns same if we do INFINITY < INFINITY - 1.
In case of C++ also, I get the same result that is False.
Is this happening because we don't have a proper definition for INFINITY? Right now we just know that it's just a huge number and we can not say that INFINITY starts after some specific number 'X'.
Coming back to the problem:
Now, some number x is obviously greater than x-1. Why this is not case with INFINITY?
Python Code:
A = float('inf')
B = float('inf')
print(A > B-1) # returns False
print(A < B-1) # returns False
C++ Code:
#include <iostream>
#include <limits>
using namespace std;
int main()
double a = numeric_limits<double>::infinity();
double b = numeric_limits<double>::infinity();
if (a>(b-1))cout<<"TRUE";
else cout<<"FALSE"<<endl; //returns else part- FALSE
if (a<(b-1))cout<<"TRUE";
else cout<<"FALSE"; //returns else part- FALSE
return 0;
For any other number = 10, number > number - 1 will return True and number < number - 1 will return False.
python c++ infinity
python c++ infinity
edited Mar 28 at 7:26
kazemakase
14.6k2 gold badges31 silver badges77 bronze badges
14.6k2 gold badges31 silver badges77 bronze badges
asked Mar 28 at 7:24
Sumedh JunghareSumedh Junghare
1073 silver badges16 bronze badges
1073 silver badges16 bronze badges
1
Are you asking about the concept of infinity in math or are you asking how infinity is represented on a computer?
– AchimGuetlein
Mar 28 at 7:26
how the infinity is represented on a computer?
– Sumedh Junghare
Mar 28 at 7:34
2
In mathematics,infinity - 1is stillinfinity. So what? So ifa = infinity,b = infinity - 1, anda == bis true, obviouslya > bis false.
– fferri
Mar 28 at 7:38
@fferri: what mathematics is that? Over real numbers,x - 1never equalsx. Find me a definition of a mathematical infinity as a value and you'll find it's not something you find in real/complex math. And python/c++ standard libraries don't really cater to hyperreal numbers where you might find such things defined...
– souser12345
Mar 28 at 7:39
1
@souser12345 infinity is not a real number... ofteninfis defined asinf > xfor allxinN(natural numbers)...
– hiro protagonist
Mar 28 at 7:42
|
show 6 more comments
1
Are you asking about the concept of infinity in math or are you asking how infinity is represented on a computer?
– AchimGuetlein
Mar 28 at 7:26
how the infinity is represented on a computer?
– Sumedh Junghare
Mar 28 at 7:34
2
In mathematics,infinity - 1is stillinfinity. So what? So ifa = infinity,b = infinity - 1, anda == bis true, obviouslya > bis false.
– fferri
Mar 28 at 7:38
@fferri: what mathematics is that? Over real numbers,x - 1never equalsx. Find me a definition of a mathematical infinity as a value and you'll find it's not something you find in real/complex math. And python/c++ standard libraries don't really cater to hyperreal numbers where you might find such things defined...
– souser12345
Mar 28 at 7:39
1
@souser12345 infinity is not a real number... ofteninfis defined asinf > xfor allxinN(natural numbers)...
– hiro protagonist
Mar 28 at 7:42
1
1
Are you asking about the concept of infinity in math or are you asking how infinity is represented on a computer?
– AchimGuetlein
Mar 28 at 7:26
Are you asking about the concept of infinity in math or are you asking how infinity is represented on a computer?
– AchimGuetlein
Mar 28 at 7:26
how the infinity is represented on a computer?
– Sumedh Junghare
Mar 28 at 7:34
how the infinity is represented on a computer?
– Sumedh Junghare
Mar 28 at 7:34
2
2
In mathematics,
infinity - 1 is still infinity. So what? So if a = infinity, b = infinity - 1, and a == b is true, obviously a > b is false.– fferri
Mar 28 at 7:38
In mathematics,
infinity - 1 is still infinity. So what? So if a = infinity, b = infinity - 1, and a == b is true, obviously a > b is false.– fferri
Mar 28 at 7:38
@fferri: what mathematics is that? Over real numbers,
x - 1 never equals x. Find me a definition of a mathematical infinity as a value and you'll find it's not something you find in real/complex math. And python/c++ standard libraries don't really cater to hyperreal numbers where you might find such things defined...– souser12345
Mar 28 at 7:39
@fferri: what mathematics is that? Over real numbers,
x - 1 never equals x. Find me a definition of a mathematical infinity as a value and you'll find it's not something you find in real/complex math. And python/c++ standard libraries don't really cater to hyperreal numbers where you might find such things defined...– souser12345
Mar 28 at 7:39
1
1
@souser12345 infinity is not a real number... often
inf is defined as inf > x for all x in N (natural numbers)...– hiro protagonist
Mar 28 at 7:42
@souser12345 infinity is not a real number... often
inf is defined as inf > x for all x in N (natural numbers)...– hiro protagonist
Mar 28 at 7:42
|
show 6 more comments
2 Answers
2
active
oldest
votes
Thinking arithmetically the assertion is correct that x < x - 1. However, that is not how computers "think". Floating point numbers suffer from limited precision. Not even this holds:
print(1e90 < 1e90 - 1) # False
print(1e90 == 1e90 - 1) # True
That is because 1e90 - 1 is rounded to 1e90 when using double precision.
Something similar happens when working with infinity values. Before comparing, the expression inf - 1 is evaluated.
What does - inf - 1 evaluate to? There is only a single value to represent positive infinity so inf - 1 evaluates to inf.
In consequence, when you compare inf < inf - 1 you actually compare inf < inf and that's why you get False.
This is incorrect with respect to infinity. Any common definition of infinity has the propertyx+a = xanda*x = xfor all real numbersa
– Yngve Moe
Mar 28 at 7:47
@YngveMoe yep, but I thought a more informal explanation might be appropriate here. Besides, I'm not sure if infinity is always defined like that.
– kazemakase
Mar 28 at 7:50
You might be able to find another way of defining infinity with that property, but it's not anything I've ever seen in my maths degree.
– Yngve Moe
Mar 28 at 7:53
@YngveMoe Well actually, I removed the part with 1 less than infinity. That should make the answer mathematically correct (and also simpler!). Do you agree?
– kazemakase
Mar 28 at 7:53
That's much better
– Yngve Moe
Mar 28 at 7:55
add a comment |
Infinity is not a number, not at least a real/complex one. It cannot be represented as a single value in mathematical domains. As such, it's not a meaningful operation to perform arithmetic on an "infinity" or compare it with anything.
But the brave engineers over at IEEE did standardize one way of representing infinity in their floating point standards. Their vision of an "infinity" should be well specified in IEEE-754.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55392140%2fcomparing-infinity%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thinking arithmetically the assertion is correct that x < x - 1. However, that is not how computers "think". Floating point numbers suffer from limited precision. Not even this holds:
print(1e90 < 1e90 - 1) # False
print(1e90 == 1e90 - 1) # True
That is because 1e90 - 1 is rounded to 1e90 when using double precision.
Something similar happens when working with infinity values. Before comparing, the expression inf - 1 is evaluated.
What does - inf - 1 evaluate to? There is only a single value to represent positive infinity so inf - 1 evaluates to inf.
In consequence, when you compare inf < inf - 1 you actually compare inf < inf and that's why you get False.
This is incorrect with respect to infinity. Any common definition of infinity has the propertyx+a = xanda*x = xfor all real numbersa
– Yngve Moe
Mar 28 at 7:47
@YngveMoe yep, but I thought a more informal explanation might be appropriate here. Besides, I'm not sure if infinity is always defined like that.
– kazemakase
Mar 28 at 7:50
You might be able to find another way of defining infinity with that property, but it's not anything I've ever seen in my maths degree.
– Yngve Moe
Mar 28 at 7:53
@YngveMoe Well actually, I removed the part with 1 less than infinity. That should make the answer mathematically correct (and also simpler!). Do you agree?
– kazemakase
Mar 28 at 7:53
That's much better
– Yngve Moe
Mar 28 at 7:55
add a comment |
Thinking arithmetically the assertion is correct that x < x - 1. However, that is not how computers "think". Floating point numbers suffer from limited precision. Not even this holds:
print(1e90 < 1e90 - 1) # False
print(1e90 == 1e90 - 1) # True
That is because 1e90 - 1 is rounded to 1e90 when using double precision.
Something similar happens when working with infinity values. Before comparing, the expression inf - 1 is evaluated.
What does - inf - 1 evaluate to? There is only a single value to represent positive infinity so inf - 1 evaluates to inf.
In consequence, when you compare inf < inf - 1 you actually compare inf < inf and that's why you get False.
This is incorrect with respect to infinity. Any common definition of infinity has the propertyx+a = xanda*x = xfor all real numbersa
– Yngve Moe
Mar 28 at 7:47
@YngveMoe yep, but I thought a more informal explanation might be appropriate here. Besides, I'm not sure if infinity is always defined like that.
– kazemakase
Mar 28 at 7:50
You might be able to find another way of defining infinity with that property, but it's not anything I've ever seen in my maths degree.
– Yngve Moe
Mar 28 at 7:53
@YngveMoe Well actually, I removed the part with 1 less than infinity. That should make the answer mathematically correct (and also simpler!). Do you agree?
– kazemakase
Mar 28 at 7:53
That's much better
– Yngve Moe
Mar 28 at 7:55
add a comment |
Thinking arithmetically the assertion is correct that x < x - 1. However, that is not how computers "think". Floating point numbers suffer from limited precision. Not even this holds:
print(1e90 < 1e90 - 1) # False
print(1e90 == 1e90 - 1) # True
That is because 1e90 - 1 is rounded to 1e90 when using double precision.
Something similar happens when working with infinity values. Before comparing, the expression inf - 1 is evaluated.
What does - inf - 1 evaluate to? There is only a single value to represent positive infinity so inf - 1 evaluates to inf.
In consequence, when you compare inf < inf - 1 you actually compare inf < inf and that's why you get False.
Thinking arithmetically the assertion is correct that x < x - 1. However, that is not how computers "think". Floating point numbers suffer from limited precision. Not even this holds:
print(1e90 < 1e90 - 1) # False
print(1e90 == 1e90 - 1) # True
That is because 1e90 - 1 is rounded to 1e90 when using double precision.
Something similar happens when working with infinity values. Before comparing, the expression inf - 1 is evaluated.
What does - inf - 1 evaluate to? There is only a single value to represent positive infinity so inf - 1 evaluates to inf.
In consequence, when you compare inf < inf - 1 you actually compare inf < inf and that's why you get False.
edited Mar 28 at 8:01
answered Mar 28 at 7:44
kazemakasekazemakase
14.6k2 gold badges31 silver badges77 bronze badges
14.6k2 gold badges31 silver badges77 bronze badges
This is incorrect with respect to infinity. Any common definition of infinity has the propertyx+a = xanda*x = xfor all real numbersa
– Yngve Moe
Mar 28 at 7:47
@YngveMoe yep, but I thought a more informal explanation might be appropriate here. Besides, I'm not sure if infinity is always defined like that.
– kazemakase
Mar 28 at 7:50
You might be able to find another way of defining infinity with that property, but it's not anything I've ever seen in my maths degree.
– Yngve Moe
Mar 28 at 7:53
@YngveMoe Well actually, I removed the part with 1 less than infinity. That should make the answer mathematically correct (and also simpler!). Do you agree?
– kazemakase
Mar 28 at 7:53
That's much better
– Yngve Moe
Mar 28 at 7:55
add a comment |
This is incorrect with respect to infinity. Any common definition of infinity has the propertyx+a = xanda*x = xfor all real numbersa
– Yngve Moe
Mar 28 at 7:47
@YngveMoe yep, but I thought a more informal explanation might be appropriate here. Besides, I'm not sure if infinity is always defined like that.
– kazemakase
Mar 28 at 7:50
You might be able to find another way of defining infinity with that property, but it's not anything I've ever seen in my maths degree.
– Yngve Moe
Mar 28 at 7:53
@YngveMoe Well actually, I removed the part with 1 less than infinity. That should make the answer mathematically correct (and also simpler!). Do you agree?
– kazemakase
Mar 28 at 7:53
That's much better
– Yngve Moe
Mar 28 at 7:55
This is incorrect with respect to infinity. Any common definition of infinity has the property
x+a = x and a*x = x for all real numbers a– Yngve Moe
Mar 28 at 7:47
This is incorrect with respect to infinity. Any common definition of infinity has the property
x+a = x and a*x = x for all real numbers a– Yngve Moe
Mar 28 at 7:47
@YngveMoe yep, but I thought a more informal explanation might be appropriate here. Besides, I'm not sure if infinity is always defined like that.
– kazemakase
Mar 28 at 7:50
@YngveMoe yep, but I thought a more informal explanation might be appropriate here. Besides, I'm not sure if infinity is always defined like that.
– kazemakase
Mar 28 at 7:50
You might be able to find another way of defining infinity with that property, but it's not anything I've ever seen in my maths degree.
– Yngve Moe
Mar 28 at 7:53
You might be able to find another way of defining infinity with that property, but it's not anything I've ever seen in my maths degree.
– Yngve Moe
Mar 28 at 7:53
@YngveMoe Well actually, I removed the part with 1 less than infinity. That should make the answer mathematically correct (and also simpler!). Do you agree?
– kazemakase
Mar 28 at 7:53
@YngveMoe Well actually, I removed the part with 1 less than infinity. That should make the answer mathematically correct (and also simpler!). Do you agree?
– kazemakase
Mar 28 at 7:53
That's much better
– Yngve Moe
Mar 28 at 7:55
That's much better
– Yngve Moe
Mar 28 at 7:55
add a comment |
Infinity is not a number, not at least a real/complex one. It cannot be represented as a single value in mathematical domains. As such, it's not a meaningful operation to perform arithmetic on an "infinity" or compare it with anything.
But the brave engineers over at IEEE did standardize one way of representing infinity in their floating point standards. Their vision of an "infinity" should be well specified in IEEE-754.
add a comment |
Infinity is not a number, not at least a real/complex one. It cannot be represented as a single value in mathematical domains. As such, it's not a meaningful operation to perform arithmetic on an "infinity" or compare it with anything.
But the brave engineers over at IEEE did standardize one way of representing infinity in their floating point standards. Their vision of an "infinity" should be well specified in IEEE-754.
add a comment |
Infinity is not a number, not at least a real/complex one. It cannot be represented as a single value in mathematical domains. As such, it's not a meaningful operation to perform arithmetic on an "infinity" or compare it with anything.
But the brave engineers over at IEEE did standardize one way of representing infinity in their floating point standards. Their vision of an "infinity" should be well specified in IEEE-754.
Infinity is not a number, not at least a real/complex one. It cannot be represented as a single value in mathematical domains. As such, it's not a meaningful operation to perform arithmetic on an "infinity" or compare it with anything.
But the brave engineers over at IEEE did standardize one way of representing infinity in their floating point standards. Their vision of an "infinity" should be well specified in IEEE-754.
answered Mar 28 at 7:35
souser12345souser12345
12.8k6 gold badges54 silver badges73 bronze badges
12.8k6 gold badges54 silver badges73 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55392140%2fcomparing-infinity%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Are you asking about the concept of infinity in math or are you asking how infinity is represented on a computer?
– AchimGuetlein
Mar 28 at 7:26
how the infinity is represented on a computer?
– Sumedh Junghare
Mar 28 at 7:34
2
In mathematics,
infinity - 1is stillinfinity. So what? So ifa = infinity,b = infinity - 1, anda == bis true, obviouslya > bis false.– fferri
Mar 28 at 7:38
@fferri: what mathematics is that? Over real numbers,
x - 1never equalsx. Find me a definition of a mathematical infinity as a value and you'll find it's not something you find in real/complex math. And python/c++ standard libraries don't really cater to hyperreal numbers where you might find such things defined...– souser12345
Mar 28 at 7:39
1
@souser12345 infinity is not a real number... often
infis defined asinf > xfor allxinN(natural numbers)...– hiro protagonist
Mar 28 at 7:42