Is retardating a word? Let's assume it is.
Just thought I'd share this script I made to convert decimal to hexadecimal, as an example of how retarded I can be.
I don't even know what I was doing, or why I was doing it. Then I looked at it and went '... Oh my god.' and created the latter.
PHP Code:
function math_DecToHex(decv) {
temp.hex = "0123456789ABCDEF";
temp.places = int(log(16,decv));
temp.total = decv;
for (temp.h = temp.places; temp.h >= 0; temp.h--) {
temp.subtract = int(temp.total/(16^temp.h));
if (temp.total < 16^temp.h) continue;
temp.newvalue = temp.subtract;
temp.total -= temp.subtract * (16^temp.h);
temp.toreturn @= temp.hex.substring(temp.subtract,1);
}
return temp.toreturn;
}
PHP Code:
function math_DecToHex(decv) {
temp.hex = "0123456789ABCDEF";
temp.total = decv;
while (int(temp.total) > 0) {
temp.toreturn = temp.hex.substring(temp.total%16,1) @ temp.toreturn;
temp.total = int(temp.total/16);
}
return temp.toreturn;
}