The Enchanted Cave 2
Delve into a strange cave with a seemingly endless supply of treasure, strategically choos
4.34 / 5.00 31,296 ViewsGhostbusters B.I.P.
COMPLETE edition of the interactive "choose next panel" comic
4.07 / 5.00 10,082 Viewsjust with a simple console program i tried this:
#include <iostream>
using namespace std;
int main()
{
cout << (0/10) << endl;
cout << (0/5) << endl;
cout << (0/0) << endl;
system("PAUSE");
return 0;
}
in the console i get:
0
0
and then it crashes saying it has encountered a problem and needs to close??? wtf
i might understand this happening if you did 10/0 (which devc++ gives me a warning for) but 0/0 = 0 not undefined like 10/0
or atleast thats what ive been taught in maths that 0/0 = 0
At 7/17/05 02:58 AM, dELta_Luca wrote: or atleast thats what ive been taught in maths that 0/0 = 0
What kind of retarded math teacher taught you that?
the reason that i brought this up is that according to wilkipedia - the natural exponention of a quaternion is exp(p) = exp(a)(cos(|u|)+sgn(u)sin(|u|))
where the quaternion 'p' = (a,u) with u being a vector
and sgn(p) = p divided by |p| or the unit quaternion
yet, like with complex numbers if you discard the other values as 0's then the complex and quaternion number acts exactly like a normal number in all of its functions and operations such that
(10,0,0,0) + (20,0,0,0) = 10+20 and (10,0,0,0)*(5,0,0,0) = 5*10 = 10*5 (wheras normally quaternion multiplication is non-commutive)
yet following wilkipedias formula for the exp() of a quaternion - if you try and find it with a quaternion of (10,0,0,0) - i need up getting this - (-1.#IND, -1.#IND, -1.#IND, -1.#IND)
the only reason i can think of this is because of the sgn(u) part which is finding the unit vector - except that the vector is 0,0,0 and that vector divided by its length 0 - is returning the #IND part
At 7/17/05 02:59 AM, White_Rhyno wrote:At 7/17/05 02:58 AM, dELta_Luca wrote: or atleast thats what ive been taught in maths that 0/0 = 0What kind of retarded math teacher taught you that?
well thats what ive been taught ever since i started using division in math and since im still only in the 9th year and havnt even started my GCSE's yet (end of school exams) and that alot of kids in my class dont understand trigonemtry still i guess my teachers have never thought to TRY and teach us any different
ah well, i managed to figure my way around it -
Quad qexp ()
{
double m = v.mod();
m = m == 0 ? 1 : m;
Vector l = v*(1/m);
Quad ex (exp(s)+cos(m), l*sin(m));
return (ex);
}
works fine even with a quaternion of (10,0,0,0) which returns (22027,0,0,0) (accuracte enough as exp(10) = 22026.5)
does anyone know how you can be more accuracte than a double - like a double double or sumtin
ah wait, i figure out why it wasnt perfectly accuracte with the exp() of the number - the formula is exp(a) times the rest - i was doing it as an add to the cos() -
Quad cexp ()
{
double m = v.mod();
double m2 = m == 0 ? 1 : m;
Vector l = v*(1/m2);
double exps = exp(s);
Quad ex (exps*cos(m), l*(sin(m)*exps));
return (ex);
}
returns a perfect exponential
exp 120 = 1.30418e+52
exp (120,0,0,0) = (1.30418e+52,0,0,0)
0/0 can't be calculated by processors. Doing it in any language will crash the program (unless you have an exception handler). Only God knows how you "got around it".
And GCSEs Delta? I'm starting them next term too. Except, I'll be finishing off my A-Level at the same time :)
well by 'got around it' i mean i just added an exception handler which in the case of the vector having a length of 0 - it just leaves it as it is instead of dividing each element by the length
Thanks, dELta_Luca for helping me make a moving image. Here is what I made which is also on ny avatar.
actually anything/0 = infinity, deviding by 0 is a mathematical nono, C will crash doing it... and for a good reason
i thought a positive number /0 = infinity and a negative number divided by 0 = -infinity?
At 7/17/05 02:31 PM, dELta_Luca wrote: i thought a positive number /0 = infinity and a negative number divided by 0 = -infinity?
That is true, but 0/0 is definetely an indeterminate number. I'm going to assume everyone knows what a limit is....
Let's say we have two functions...
f(x)= 5x/x
g(x)= 2x/x
Now let's determine the limit of each function as it approaches zero from the left and right... At zero, both will equal the fraction of 0/0, but what do the limits look like?
For function f it's going to be 5, and for function g it's going to be 2. Yes this function does indeed have removable discontinuity, but all functions that end up with a value of 0/0 have removable discontinuity. If you have gone through calculus, you know that little trick, plug in the value that the function is approaching. If it's an irrational number with a zero in the denominator, then you know that it is approaching either infinity or -infinity, depending on the signs. But, if you plug in the value and it's 0/0, it's a clue for you to check for removable discontinuity.
Yes this function
Dividing anything by 0 in C++ will cause a crash, whether you like it or not.
Dividing 0/6 is legal, 6/0 is not legal.
"no sound in ass"