Published: Feb 26 2013 / 08:36
Whilst reasonably interesting from an academic point of view, the addition and multiplication methods will fail if anything overflows. The multiplication method will fail if one of the variables is zero. Also all of the methods are harder to read and will probably be slower than using a temp variable and a decent compiler...
Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.
Advertising - Terms of Service - Privacy - © 1997-2014, DZone, Inc.