I wouldn't run this if I were you:
Javascript:
(function() {
var a = 1,
b = a,
c = b,
d = 1,
e = 1;
while ( d != 0 && e != 0) {
b = Math.sqrt(a*a+a*a);
c = 2*a-b;
e = b%1;
f = c%1;
document.write(a);
a++;
}
document.write('a = ' + a);
document.write('b = ' + b);
document.write('c = ' + c);
})();
Yeah basically I want to calculate the same equation over and over again until all three are integers with Javascript and then print them out. Please know that up until recently I only used jQuery.
This seems to just repeat infinitely though I find it weird that it does not print a
while calculating, not sure if thats how the javascript while loop works.
Also, why can't i use Math.sqrt(2a^2)
to calculate B?
d
sod != 0
will always be true, why do you expecte
to ever be exactly zero? – mu is too short Mar 6 '12 at 5:09