J
John Kopanas
I have the following:
a = (y != 0) ? (x/y) : 0
There must be a sexier way of doing this! Any suggestions?
On a side note... how do we do exception handling on the same line as statement?
a = x/y rescue 0
That does not work but does it make sense? Is it because dividing by
zero does not throw an exception?
Thanks for your help!
Your Friend,
John
--
John Kopanas
(e-mail address removed)
http://www.kopanas.com
http://www.cusec.net
http://www.soen.info
a = (y != 0) ? (x/y) : 0
There must be a sexier way of doing this! Any suggestions?
On a side note... how do we do exception handling on the same line as statement?
a = x/y rescue 0
That does not work but does it make sense? Is it because dividing by
zero does not throw an exception?
Thanks for your help!
Your Friend,
John
--
John Kopanas
(e-mail address removed)
http://www.kopanas.com
http://www.cusec.net
http://www.soen.info