On 1/2/2013 10:11 AM, majeti dinesh wrote: > I am obtaining the value -1.#IND0 in computing a value. > > The formula used for the computation is > > r = s + u2*sqrt(u1/(1-u1)) where u2 and u1 are uniform random numbers between [0 1]. > > Sometimes the value is -1.#IND0 and sometimes it is not. > I am unable to understand the reason for this. I would be grateful for any help.
Test the inputs for validity for the operation first or use try...catch and fixup the error cases or some other way to avoid things like u1==1.
Depending on the value of s other nasty things can happen (particularly if it could be <0)