Created
January 10, 2010 10:01
-
-
Save erikbgithub/273420 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function add_classical($nr1, $nr2, $type='decimal'){ | |
$sum = NULL; | |
switch($type){ | |
case 'decimal': | |
$sum = (int)$nr1 + (int)$nr2; | |
case 'binary': | |
$sum = bindec($nr1) + bindec($nr2); | |
} | |
return $sum; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment