-
Infinity?
Some of you already know this. But it could be fun for people new to it.
Translate to your language of choice:
"How to Spell out infinity using only numbers"
(Java)
Code:
double a = 10;
double b = 10;
double c = 10;
double d = 10;
double e = 10;
double f = a * b;
double g = f * e;
double h = g * f;
double i = a + b + c * f + g;
double j = i / a;
double k = j * i * h * g / f;
double l = Math.pow (k, e);
double m = Math.sqrt (l);
double n = a * b * c * d * e * f / g / h / i / j / k * l * l * l - m;
System.out.print (n);
Try it out ;)
-
(C++)
Code:
#include <iostream>
#include <math.h>
using namespace std;
int main() {
double a = 10;
double b = 10;
double c = 10;
double d = 10;
double e = 10;
double f = a * b;
double g = f * e;
double h = g * f;
double i = a + b + c * f + g;
double j = i / a;
double k = j * i * h * g / f;
double l = pow (k, e);
double m = sqrt (l);
double n = a * b * c * d * e * f / g / h / i / j / k * l * l * l - m;
cout << n;
}
And yes, quite interesting.. :) Kind'a expected an buffer overfloat..
-
-
Quote:
Originally Posted by
Pieman
uhh, what does it do? =/
Displays "1.#INF"
-
Well, it basically is an overflow, thats just how it tells you that there is an overflow, you could do 99999^99999 ect.. But its more fun to do with lots of variables and math sequences =P