------art_29853_11393715.1168024693380
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On 1/5/07, Jay Bornhoft <jbornhoft / gmail.com> wrote:
>
> Btw, is there a way to get the same 'def' to process both the positive
> and negative 'x' values?
>
>
You could have it return an array, where the first element is the 1st
solution and the second element is the 2nd solution:

def quad(a,b,c)
  [   -b + ((b**2 - 4.0*a*c)/(2.0*a))**(0.5),  -b - ((b**2 - 4.0*a*c)/(2.0*a
))**(0.5) ]
end

------art_29853_11393715.1168024693380--