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": "036307bb5ba4fa3b25f17b5eef0e049764641ca8bed03ce80a2f6b891df127b6",
"pubkey": "2f3afe951cf211bd163306f5698222e2f16c25b928743efba74f3d135d848c10",
"created_at": 1725299641,
"kind": 1,
"tags": [
[
"proxy",
"https://cosocial.ca/@timbray/113069237279290890",
"web"
],
[
"proxy",
"https://cosocial.ca/users/timbray/statuses/113069237279290890",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://cosocial.ca/users/timbray/statuses/113069237279290890",
"pink.momostr"
],
[
"-"
]
],
"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": "ac1e77836ac3b6b816b2bf0c731c811a055444d2e7906f0f3f5a3c19d2c88a1c8834d85d6645eb9b93f17bbf742525dd1d99c221aec8ee0f032f3130c186ad98"
}