I think you want something more like a >= 0 && b >= 0 && c >= 0
Also, you probably don't want to use global variables for code where performance matters. You should pass a, b and c to gen() as parameters gen(a, b, c). -- John On Jul 15, 2014, at 6:31 PM, [email protected] wrote: > Hi, > > I am working on a Markov chain Monte Carlo script right now and am trying to > figure out the parameter generation part of the script. In pseudocode, I am > trying to do > > a = 0.1 > b = 0.1 > c = 0.1 > > function gen() > a = a + rand() > b = b + rand() > c = c + rand() > if a & b & c >= 0 > return a,b,c > end > > However, this returns the error message ERROR: no method &(Float64) > How do I combine my comparisons and compare floats? > > Thanks for your help, > WX
