[omfg] a / b = 4,000,000,000

Code:
#include <iostream>
using namespace std;
int main () 
{
    int a = 1;
    int b = 1;
    int i = 1;
    while(i > 0)
    {
       cout << a+b;
       a = a+b;
       b = a*b;
     }
   return 0;
}
There infinite answers.
It wont stop

Until you overflow your variable and come crashing back to earth. ;)
 
Close tbob, for that to work its gonna need to look like this, but it will still overflow at one point, but give every possible answer that the variable can
Code:
#include <iostream>
using namespace std;
int main () 

{
   long double a;
   long double b;
   long double incra = .1;

   for(b = incra; b <=  4000000000 ; b = b + incra)
   {
       a = 4000000000 / b;
       cout << "A is:" <<a<< " B is:" <<b<<;
       if(b == 4000000000)
       {
          b = incra / 10;
          incra = incra / 10;
       }
   }
return 0;
}

Every possible answer that this language can support.
 
Computers are awesome at representing an infinite amount of numbers with their finite sized registers.
 
That's like your wife saying, "You can have sex with any women, except the good looking ones."

It isn't every possible answer, as there are an infinite number of answers.

you can't get INFINITE answers no matter what you'll have a finite set, its just a matter of how CLOSE you can get.
 
Can't believe i didn't catch that sooner.....

Code:
#include <iostream>
using namespace std;
int main () 

{
   long double a;
   long double b;
   long double incra = .1;

   for(b = incra; b <=  4000000000 ; b = b + incra)
   {
       a = 4000000000 * b;
       cout << "A is:" <<a<< " B is:" <<b<<;
       if(b == 4000000000)
       {
          b = incra / 10;
          incra = incra / 10;
       }
   }
return 0;
}

TIMES NOT DIVIDE!!!!
 
this thread is certifiably stupid.

like, tap water stupid...no, not even that smart

seriously i cannot find an analogy appropriate enough to express just how stupid this thread is.
 
this thread is certifiably stupid.

like, tap water stupid...no, not even that smart

seriously i cannot find an analogy appropriate enough to express just how stupid this thread is.

Probably: Stupid as this guy I know's dad, who asked him this question in response to his son's saying something about wanting a career in mathematics.

See, his dad's a hate mongering super-Christian.
 
Probably: Stupid as this guy I know's dad, who asked him this question in response to his son's saying something about wanting a career in mathematics.

See, his dad's a hate mongering super-Christian.
:huh:

edit: oh, oh, ok i get it now...you made the thread because some kid's dad is a churchie and asked the question in order to de-value math.

the way you structured that made my head hurt
 
Last edited:
I'm sure the language can support more, you just need use a data structure that can grow as large as the available memory. But even then, you will not come even come close to the infinite number of solutions that exist. Maybe you need to understand the definition of "infinite".
 
By the way, I say "this guy I know" instead of "friend" because I hate his pompous ass.

edit: Oh, and "FIGURE THAT OUT, SMART GUY!" is a direct quote.

Mega-edit:
:huh:

edit: oh, oh, ok i get it now...you made the thread because some kid's dad is a churchie and asked the question in order to de-value math.

the way you structured that made my head hurt

Yeah, sorry, I haven't slept in...oh...20 some odd hours.

THE EDIT OF DESTINY: btw the kid's response was "Well, that depends. a = 4,000,000,000b and b = (1/4,000,000,000)a
 
Last edited:
I'm sure the language can support more, you just need use a data structure that can grow as large as the available memory. But even then, you will not come even come close to the infinite number of solutions that exist. Maybe you need to understand the definition of "infinite".
No, everyone needs to understand the definition of a recursively enumerable set. It's easy to write a program that will print out an infinite set (given enough time and resources), but in this particular case the set of solutions isn't recursively enumerable, in fact it's even uncountable, so you're screwed.
 
Back
Top