C
C#2y ago
Thinker

✅ 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
Jester
Jester2y ago
#allow-unsafe-blocks one of them probably wanned it
Thinker
Thinker2y ago
Should've guessed omegalul
Klarth
Klarth2y ago
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.
Thinker
Thinker2y ago
ah, cool
Aaron
Aaron2y ago
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
Klarth
Klarth2y ago
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.
Want results from more Discord servers?
Add your server