I want to round a number and I need a proper integer because I want to use it as an array key. The first \"solution\" that comes to mind is:
$key = (int)roun
What about simply adding 1/2 before casting to an int?
eg:
$int = (int) ($float + 0.5);
This should give a predictable result.