✅ Is System.Half ever used?
Just wondering, what's the point of
System.Half
? It doesn't even have an alias unlike most of the other numeric types. I assume it's in the same boat as Int128
where it's a numeric type in System
but doesn't have the runtime support of the other numeric types?6 Replies
#allow-unsafe-blocks one of them probably wanned it
Should've guessed
It's a bit underbaked at the moment, but it's mostly there for ML and simulation work where high precision isn't necessary...but compact memory size is.
Like the approximations in a lot of simulation work will be within 5% if you're lucky, so who cares if you use
float
or double
because the amount of floating point error won't ever approach that.ah, cool
yeah it is, its all done in software too iirc?
doesn't seem like it?
¯\_(ツ)_/¯
but yeah, if you have a huge set of floats, sometimes them taking up 2 bytes instead of 4 is worth it
Even 10 years ago, the larger memory supercomputer nodes I had access to were 6 GB / core (as opposed to 4GB / core for the "low end").
So it really helps where you might have tens of GB allocated for giant matrices across a calculation. Probably more with "routine" high end calculations now.