Tim Bray on Nostr: 1/2 Hey folks, to welcome September, a pair of ultrageek blog posts on representing ...
1/2 Hey folks, to welcome September, a pair of ultrageek blog posts on representing 64-bit IEEE 754 floats in the minimum possible number of UTF-8 bytes. The 95% of you who just thought “Huh? What?” or “Who even cares” are being entirely sensible. For the rest of you, here’s “Q Numbers Redux”:
https://www.tbray.org/ongoing/When/202x/2024/08/28/Q-Numbers-2 which contains this terrifying Go code:
mask := (u>>63)*^uint64(0) | (1 << 63)
return numbits(u ^ mask)
Published at
2024-09-02 17:54:01Event JSON
{
"id": "90cb7eaef1399ba12469e59d925d6204773b365616077972ebeb2d080346929f",
"pubkey": "973c779cb5e72ff0b6f0f47f8e86aee1face1c21b80ae0d9bc50968aa717e4b8",
"created_at": 1725299641,
"kind": 1,
"tags": [
[
"proxy",
"https://cosocial.ca/users/timbray/statuses/113069237279290890",
"activitypub"
]
],
"content": "1/2 Hey folks, to welcome September, a pair of ultrageek blog posts on representing 64-bit IEEE 754 floats in the minimum possible number of UTF-8 bytes. The 95% of you who just thought “Huh? What?” or “Who even cares” are being entirely sensible. For the rest of you, here’s “Q Numbers Redux”: https://www.tbray.org/ongoing/When/202x/2024/08/28/Q-Numbers-2 which contains this terrifying Go code:\n mask := (u\u003e\u003e63)*^uint64(0) | (1 \u003c\u003c 63)\n return numbits(u ^ mask)",
"sig": "47f343ff31089eccb85aceba467a2113a10d961b4cb97a6c50ebbf8017952752ad92b9fee8b13b78db934757740bf974940e59eab89fddeed929f921f1d88b1b"
}