I found a weidness in gcc2.2.2d. It may be my silly code but I tested
the code with gcc compiler at uni(gcc...not sure of the version) and it worked
fine...well, like what I expected. The code is a edited fragment of a code
I am writing to do a monte carlo stuff. I use exp() function.
Here is what goes wrong. When I enter values of 1000 for values of
x, I get a huge number when what I was expecting was rather small number(
more like 0). I get zero at uni gcc compiler so I guess there is nothing
wrong with my code...It is not just 1000 that makes the thing go
funny, but numbers around 1000....x+y.....seems to give me funny values.
But then again, when I enter values much larger, then the code works okay and
gives me something pretty close to zero.
Okay, I am running pl4 without 387 and I have set the emulation on(would it
work(the kernel) if I have set emulation to off? coz I am not 100% sure if
I did set it off. I never had any crashes so I assumed that I compiled it right)Also, I would like to mention that if I have small value for x then the thing
seems to work fine.
Okay, I had further experiments with the code and at x value of 709,
this is the output I get...
[pasted using xterm...so I am not making up anything..:)]
p0 2:12 linux[136] a.out 709 ~
Current I: <.16781e-309
I have never seen such output so can someone help me to the right
direction? Or is it a bug?(nah...I don't think I can ever find a bug..;-> )