Archive

Archive for July, 2015

Can floating point representation be improved?

24.07.2015 Leave a comment

If you ever wrote any code which used floating point numbers, you are probably aware, that the widespread floating point format, also known as IEEE-754, is full of caveats.

Due to the representation used, floating point computations are usually unstable. The errors of certain operations grow rapidly, operations are order-dependent and you can obtain different results on different architectures.

Here is an incredibly promising proposal of unum, a number format which improves the current floating point format in all areas: John Gustafson Explains Energy Efficient Unum Computing.

There are many areas, where this could provide improvements, not only in the quality of programs, but also in energy efficiency.

In particular, scripting languages would benefit from it a lot. For example, JavaScript has a single Number type. This creates a lot of problems, because it is hard to make computations reliable, and there is a limited precision for integers. Using floating point representation for integers was a very bad design choice for JavaScript. With unum, this could change and a single numeric format would make sense.

Another example are statically typed languages, where an elaborate type system leads to headaches. With unum, this would no longer be a problem, and the type system could be simplified, especially because unums can be represented with a variable number of bits (although do not have to). Integer calculations can be carried as fast with unum as they can be carried out in regular 2’s complement representation. And at the same time, unums support floating point numbers.

Will unum prove to be useful and become widespread? I certainly hope so.

Advertisements
Categories: Computing