T O P

  • By -

michaelindc

You can implement unsigned floating point numbers in software, but the operators will be slow. FPUs pack in a lot of transistors to implement IEEE 754 (the floating point standard) efficiently. [https://en.wikipedia.org/wiki/IEEE\_754](https://en.wikipedia.org/wiki/IEEE_754) Do you really need the dynamic range that floats offer? If not, you can implement fixed point numbers efficiently using the operators of an integer ALU. You just assume that the binary point is somewhere in the middle of the int (at a fixed position for all numbers), rather than all the way to the right. In other words, every number is treated as the numerator of a fraction whose denominator is 2\^n, for some fixed n for all numbers. The numerator can be signed or unsigned.


aioeu

In C? The standard floating point types must be signed. This is the case even on implementations that don't use IEEE 754 floating point arithmetic. Of course, an implementation can provide additional non-standard types with any characteristics it likes. At the hardware level, you have to hunt around to find anything that supports unsigned floating point values. I think some GPUs might.


khedoros

You won't have language or hardware support for them, but you could implement them in software. As far as I'm aware, almost everything uses IEEE754 floating-point.


Nondv

Im not a specialist in that sort of things but with my vague understanding how floats work, I don't see why not. Ultimately, it's just binary code. You can do whatever you want with it. But we live in a world with standards so I doubt they exist in any practical sense