What is Nostr?
Fabian Giesen /
npub1sqn…r8se
2023-11-23 07:05:26
in reply to nevent1q…dw0a

Fabian Giesen on Nostr: npub1f3nlr…me887 FWIW, no compiler that I'm aware of implements this, but the ...

npub1f3nlrmpjja65pzmvlegyl27l0y2m007nncxttdwqndrejajvdzas2me887 (npub1f3n…e887) FWIW, no compiler that I'm aware of implements this, but the actual solution is sext int32->int64, convert int64->float64, float64 divide, convert back to int32 with truncate.

I've only ever needed this for narrower ranges where I could comfortably work in float32 instead and you need to be a bit careful with this kind of thing because of double-rounding but in this case, pretty sure there's no issue.

(I'd need to write a proof to be sure but with float64 there's plenty of margin.)
Author Public Key
npub1sqndnjhteg95ss2tk5xdmld540vv8hlhkpa4altk9cagjqrwrvhqurr8se