News for hackers. Stuff that matters.
Re:How does your programming language handle “minus zero” (-... by amelius on Friday March 05, 2021 @12:01PM (#26359093)
> Floats are essential for

Not necessarily true. Theoretically you can replace floats by fixed-point representations given enough bits, and in practice this also works often.

It's a pity languages/hardware don't have good built-in support for fixed-point numbers though.

Re:How does your programming language handle “minus zero” (-... by civilized on Friday March 05, 2021 @04:03PM (#26362071)
Okay, so now, relative to floating point arithmetic, you've sacrificed an enormous amount of dynamic range and have to worry about overflow and underflow much more than before.

What did you gain from this, exactly?

I'm sure there are some special situations where fixed point is better, but for general purpose scientific and technical computing, floating point is obviously the right choice.

Re:How does your programming language handle “minus zero” (-... by hctaw on Friday March 05, 2021 @05:09PM (#26362794)
On some low power architectures without FPUs it is significantly more power/compute efficient to use fixed point arithmetic. But that's really it.
Re:How does your programming language handle “minus zero” (-... by hctaw on Friday March 05, 2021 @05:08PM (#26362770)
Fixed point is obsolete on the vast majority of compute devices today. It is only a reasonable alternative in ultra low power scenarios or on tech stacks that haven't migrated to modern architectures, like some DSPs (which are also really only applicable in ultra low power devices).

On modern CPUs, fixed point is slower and error prone (both in usage and the computations themselves) relative to floating point.

I don't think it's a pity that fixed point support is out the door. It sucks. Floats minus subnormals are the least surprising numerical representation out there, and the most versatile.

Do you really want to worry about whether your numbers are saturating or wrapping around? Keeping track of what your max/min are? Tracking decimal places? Implementing division by hand? Screw all that. Fixed point is awful and is essentially an academic exercise today.

Re:How does your programming language handle “minus zero” (-... by lostcolony on Friday March 05, 2021 @12:05PM (#26359129)
Well, as mentioned elsewhere, because of historical purposes, GPUs tend to optimize floating point operations really heavily. Whereas bigint style things likely don't benefit, in part because there's no "standard" for them at that low a level. So it seems to me to be a bit of chicken and egg; low level languages don't have them as part of the standard, so graphic cards can't universally optimize for them, and since graphic cards don't support optimizations for them, there isn't anyone clamoring for it.