Re: Math crashes with translated programs (Rob?)
- Posted by r.schr at t-online.de Jun 13, 2002
- 423 views
Andy Serpa wrote: > > > > > > -------------------------------------------------------- > > constant lim = log(3e+307) -- needed for chk_pow_args() > > > > function chk_pow_args(atom a, atom b) > > -- ------------ > > if a > 0.0 then > > if b*log(a) < lim then > > return 1 > > end if > > elsif a < 0 and integer(a) then > > if b*log(-a) < lim then > > return 1 > > end if > > end if > > return 0 > > end function > > > > Am I correct in thinking that should be integer(b) instead of integer(a) > to guard against using a non-integer exponent when the base is negative? You are right! Have a nice day, Rolf