# The Wiert Corner – irregular stream of stuff

• ## Email Subscription

Join 1,799 other followers

# Archive for May 8th, 2014

## This is madness. University textbook at full price but without ownership (via: Jan Wildeboer – Google+)

Posted by jpluimers on 2014/05/08

Having to buy a book at full price, then having to return it when your semester is finished sounds so wrong on so many levels, even if you get DRM licenses access to the content:

one of the best quotes on DRM ever: But, as Professor James Grimmelmann noted, “we know from sad experience that gerbils have better life expectancy than DRM platforms.”

–jeroen

## .NET uses banker’s rounding as default as it follows IEEE 754 (via: Stack Overflow)

Posted by jpluimers on 2014/05/08

It is almost 3 years that Ostemar wrote an interesting answer on Stack Overflow to the question

Few people (even many programmers don’t!) know about rounding and how it can influence software, let alone what bankers rounding does so lets set a few things straight first.

Rounding matters. Depending on the kinds of software you write, it matters a little, or a lot.

For instance, in these categories, it can matter an awful lot:

• Financial applications
• Statistical applications

Bankers rounding means rounding half even. Which means that #.5 will round to the even number closest to #.

In bankers rounding, 1.5 rounds to 2, 3.5 to 4 as does 4.5, -1.5 rounds to -2, -3.5 to -4 as does -4.5.

This is called “unbiased” because for reasonable distributions of y values, the expected (average) value of the rounded numbers is the same as that of the original numbers.

This is contrary to what the majority of people are accustomed to: Round half away from zero is taught in most countries (even for the Dutch, despite the alias “Dutch Rounding” for round half to even).

Round half away from zero rounds 1.5 rounds to 2, 3.5 to 4 and 4.5 to 5. Negative numbers round like this: -1.5 rounds to -2, -3.5 to -4 as does -4.5 to -5.

This is only free of overall bias if the original numbers are positive or negative with equal probability.

In short, .NET uses bankers rounding because it follows the IEEE 754 rounding rules.