New site: Blekinge.IT

As much as I try to get rid of domains I don’t use, I can’t avoid registering new domains. I recently registered two domains (singular and plural) for a project with codename Green November.

Another domain I recently registered is Blekinge.IT. At some point in the future I want it to be a site about IT and telecommunications in the Swedish province Blekinge, but for now I only use it to aggregate local news sources.

This was also a test in registering .it domains. I had to print, sign and send a fax (!) to fulfill the registration, but otherwise it was really easy.

fmod() in PHP is the worst !”#¤%&/()= function ever!

I hate floating point artithmetic and I really hate fmod() in PHP. It’s useless.

fmodReturns the floating point remainder (modulo) of the division of the arguments

If you calculate 36 modulo 7.2?  What do you get? Zero, yes. 7.2*5=36. No remainder!

What if you use fmod in PHP?

$ php -r 'echo fmod(36,7.2);'
7.2

WTF? Excuse me? Is that the result from IEEE 754 hell, a parallel universe, or what?

Now I’m betting on the function below. I hope it won’t let me down.

function modulo($n,$b) {
return $n-$b*floor($n/$b);
}