853
IEEE 754 (cdn.fosstodon.org)
submitted 10 months ago by Ephera@lemmy.ml to c/programmerhumor@lemmy.ml

~~Stolen~~ Cross-posted from here: https://fosstodon.org/@foo/113731569632505985

you are viewing a single comment's thread
view the rest of the comments
[-] arrakark@10291998.xyz 8 points 10 months ago

IEE 754 is my favourite IEEE standard. 754 gang

[-] SubArcticTundra@lemmy.ml 6 points 10 months ago

Has anyone ever come across 8 or 16 bit floats? What were they used for?

[-] wewbull@feddit.uk 4 points 10 months ago

Neural net evaluation mainly, but FP16 is used in graphics too.

[-] gandalf_der_12te@discuss.tchncs.de 2 points 10 months ago* (last edited 10 months ago)

Actually, you can consider RGB values to be (triplets of) floats, too.

Typically, one pixel takes up up to 32 bits of space, encoding Red, Green, Blue, and sometimes Alpha (opacity) values. That makes approximately 8 bits per color channel.

Since each color can be a value between 0.0 (color is off) and 1.0 (color is on), that means every color channel is effectively a 8-bit float.

[-] lennivelkant@discuss.tchncs.de 7 points 10 months ago

Aren't they fractions rather than floating point decimals?

[-] kuberoot@discuss.tchncs.de 4 points 10 months ago

Pretty sure what you're describing isn't floating-point numbers, but fixed-point numbers... Which would also work just as well or better in most cases where floats are used.

this post was submitted on 02 Jan 2025
853 points (99.3% liked)

Programmer Humor

39009 readers
236 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS