Last active
August 9, 2018 14:52
-
-
Save chukwumaokere/5fa750a14a2da5e1696d54291d531c17 to your computer and use it in GitHub Desktop.
A complication of division
This file contains 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
<?php | |
$x = 80; | |
$y = 2; | |
$nonce = 0; | |
while ($x > 0) { | |
$x = $x-$y; | |
if($x >= 0){ | |
$nonce++; | |
} | |
} | |
echo $nonce; //This prints out 40! Which means its essneitally performing 80/2 but as a longer expression | |
echo "\n"; | |
//Written as a math's equation, its something like ((x-y) = z) - y repeating until z = 0. The number of times this equation is repeatable is known as the nonce. And thats what you're solving for by dividing. | |
//TODO: write full maths equation as a Summation function. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment