From: Joe Hartman Date: 2006-12-27T14:18:32+09:00 Subject: Re: Peculiar Behavior for a Newby to Undertstand Charles A Gray wrote: > On Wed, 2006-12-27 at 11:51 +0900, Jose Augusto wrote: >> For that you need a Ruby guru :-) >> >> Kind Regards >> >> J. Augusto >> > Tahnks for the reply a=Primes.new ans a=Primes::new both give me the > same incorret result Try this: class Primes def prime?( number ) ( ( ( number / 2 ).floor ) * 2 + 1 ) end end a = Primes.new a.prime?( 1000000 ) The last variable assigned is being returned from a.prime? (in this case an anonymous variable). This is how Ruby returns a value from a method. Hope this helps. Joe -- Posted via http://www.ruby-forum.com/.