
Changing the way numbers are stored in computers could improve the accuracy of calculations without needing to increase energy consumption or computing power, which could prove useful for software that needs to quickly switch between very large and small numbers.
Numbers can be surprisingly difficult for computers to work with. The simplest are integers 鈥 a whole number with no decimal point or fraction. As integers grow larger, they require more storage space, which can lead to problems when we attempt to reduce those requirements 鈥 the infamous millennium bug arose from computer programs storing the year as a two-digit number (99 for 1999), leading to the potential for confusion when the year rolled over to 2000.
This space issue is why very large or small numbers, or even just ones with a decimal component, are stored using a technique called floating-point arithmetic. These floating-point numbers work like scientific notation: storing the significant digits, or mantissa, as one integer and an exponent as another 鈥 for example, 1,234,000 would be stored as 1234 (the mantissa) and 3 (the exponent), for 10鲁. Computers actually do this in binary, rather than the base 10 we are used to, but the principle is the same.
Advertisement
But floating-point numbers are only a useful approximation of real numbers; they are inherently inaccurate because of the limited number of digits they can store. For example, a system designed to store 1,234,000 might struggle with 1,234,567, because this would require more digits for the mantissa. Such limitations mean that floating point numbers can sometimes cause real-world issues.
狈辞飞听 at Ariel University and at Ben-Gurion University, both Israeli institutes, have designed an adapted version of floating-point representation called floating-floating-point that they say can improve accuracy and keep the amount of data required to represent the numbers to a minimum.
Essentially, floating point can assign more bits to the exponent, which increases the range of numbers that can be represented, or more bits to the mantissa, which increases the accuracy of the number. Normally this trade-off is set in stone for a particular system, but floating-floating point allows software to move the allocation dynamically, increasing accuracy when needed, or reducing it in order to ramp up the range if necessary.
鈥淵ou have to compromise significantly on the accuracy if you want to represent large numbers, and vice versa,鈥 says Cohen. 鈥淔loating-floating point tries to overcome this by letting the number of bits dedicated to the exponent and the mantissa vary, and this way we obtain both large counting range and good accuracy.鈥 Similar ideas have been proposed before, but Cohen says his and Einziger鈥檚 solution is one that could actually be implemented to ramp up or down as software runs, meaning that a better compromise is reached more often.
at the University of Sheffield, UK, says the idea could have benefits in software where numbers vary a lot during computation 鈥 shifting from the very large to the very small 鈥 such as in physics simulations.听鈥淚f we鈥檙e building something new and, or, custom, this might be a great direction to consider. It is likely to be slower than existing implementations 鈥 but if it means they can fit something into memory where it was not possible to do before, it might be worth it.鈥
But crucially, the pair have yet to demonstrate whether their idea would mean a hit on computing performance.听鈥淭he new format, the floating part, has no support in hardware, hence it鈥檚 likely to have a huge performance penalty 鈥 it might work out to be faster to use a fixed representation for numbers and more memory,鈥 says Bogdanov.
arXiv