Skip to content

Instantly share code, notes, and snippets.

@chukwumaokere
Last active August 9, 2018 14:52
Show Gist options
  • Save chukwumaokere/5fa750a14a2da5e1696d54291d531c17 to your computer and use it in GitHub Desktop.
Save chukwumaokere/5fa750a14a2da5e1696d54291d531c17 to your computer and use it in GitHub Desktop.
A complication of division
<?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