Numeric representation of real numbers, alternative to floating point format

Are there any formats for describing real numbers other than floating point format?

In particular, I ask for formats that still provide acceptable computing performance (compared to floating point), as opposed to, for example, symbolic computing.

Thanks.

Appendix: I am interested in this from the point of view of theoretical informatics. Indeed, I found a scientific article that gives a (small list) of number systems to "represent" a real number. perso.ens-lyon.fr/jean-michel.muller/chapitre1.pdf

The term "symbolic" is ambiguous, I admit. I thought of mathematics as a calculation, which is the term used in theoretical CS. Btw, “describe” does not mean “accurately describe”. However, the term “swim” does not apply because it does not make much sense. But this is far from the true question, being more philosophical.

+4
source share
4 answers

Well, there are fixed-point formats and fractions (mostly a specialized form of symbolic computation), but none of them are very popular, probably because they have no advantages over floating-point, except for very specific applications.

What are your requirements anyway? Most likely, floating point numbers are actually best suited, they are often misunderstood, usually "inaccurate." In fact, they are really very accurate within certain limits - but each format has such limitations, and without specialized equipment everything that is more accurate will be several orders of magnitude slower.

+2
source

I really like the continued fragmentation . Done lazily , they can allow you to generate accuracy as needed. They, of course, will be slower than the "native" views, such as floating point.

+2
source

I'm not sure if this is exactly what you are looking for, but ... For in-line programming, we sometimes store values ​​as signed 0.15 fixed points with an appropriate scale factor. You can think of it as saving all values ​​as fractions between -1.1 and tracking the multiplier along with units. For example, to represent 5 amperes in a variable with scaling up to 10 A, you should:

int16 I = 16384; // .5@10A = 5A 

When you do the math, you simply track the scale with the units.

  int16 R = 3277 // .1@2ohm = .2ohm int16 V = ((int32)I*R)>>15; //@10A*@2Ohm = @20V //result = 1638 => 1638/32768= .05@20V = 1V 

It takes a lot of attention to detail to work with this system, but on a system with a slow or no floating point processor, this is a way to maintain arbitrary precision and ultrafast operations.

+1
source

In particular, I ask for formats that still provide possible performance computing (compared to floating point), as opposed to, for example, symbolic computing.

Depending on what you mean by "doable." Is there anything that can do floating point style calculations at any point close to modern floating point speed? No. In fact, everything, except for its own hardware operations, is several orders of magnitude smaller.

However, modern hardware (even limited devices such as cell phones!) Are capable of performing billions of floating point operations per second. If this speed far exceeds your “feasibility” requirement, then there are many alternatives that may be acceptable, such as rational approximations, continued fractions, or software floating point ellipses.

+1
source

Source: https://habr.com/ru/post/1344145/


All Articles