log (1-var) operation in C
Posted
by
heike
on Stack Overflow
See other posts from Stack Overflow
or by heike
Published on 2012-03-30T17:26:32Z
Indexed on
2012/03/30
17:28 UTC
Read the original article
Hit count: 144
I am trying to code this algorithm. I am stuck in the part of log((1.0-u)/u))/beta
;
As I understand, I can not get the result of this in C, as it will always return me with negative value log (returning imaginary value).
Tried to print the result of log(1-5) for instance, it gives me with Nan.
How can I get the result of
double x = (alpha - log((1.0-u)/u))/beta
then?
Would appreciate for any pointers to solve this problem.
Thank you
© Stack Overflow or respective owner