in reply to Re: Modulus Inconsistencies (Or Calling all Mathematicians)
in thread Modulus Inconsistencies (Or Calling all Mathematicians)
Forgot to mention: if I recall my study of equivalence classes in modern algebra correctly, the way Perl does this is the more mathematically correct way (because e.g., seven is equal to negative two modulo three IIRC; they are both in the 1 class). But that is far less imporant for programming purposes than getting the modulus consistent with int division, because all sorts of things will break if those aren't consistent. Whole algorithms would be untenable.
for(unpack("C*",'GGGG?GGGG?O__\?WccW?{GCw?Wcc{?Wcc~?Wcc{?~cc' .'W?')){$j=$_-63;++$a;for$p(0..7){$h[$p][$a]=$j%2;$j/=2}}for$ p(0..7){for$a(1..45){$_=($h[$p-1][$a])?'#':' ';print}print$/}
|
|---|