umult64(3)

πŸ“¦
version 0.34 Β· 2 versions
  • 0.34 Β· alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 0.30 Β· fedora 43, fedora 44, ubuntu jammy
, in alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– umult64(3) β€” like, the manual page bestie πŸ’–

okay so we're in the Library Functions Manual section of the docs, and today's main character is umult64(3) β€” it's giving "multiply two numbers but make it safe" energy and honestly? iconic. 🫢


✨ NAME ✨

umult64 β€” integer multiplication, but with overflow checking, because we do NOT do silent chaos here πŸ’…


πŸ¦‹ SYNTAX πŸ¦‹

#include <libowfat/safemult.h>

int umult64(uint64 a,uint64 b,uint64* c);

🌸 DESCRIPTION 🌸

so here's the tea, bestie: umult64 does c=a*b and returns 1. that's it. that's the whole vibe. ✨

but in case of an integer overflow, it just… leaves c alone 😌 and returns 0. no touching, no overwriting, no mess. it's literally the most respectful function in the whole library fr fr.

lowkey important: if it returns 0, your c is untouched β€” so don't go reading it like it's fresh data, because it's not. 🚫

πŸ‘‘ SEE ALSO πŸ‘‘

the whole multiply-safely squad, go say hi πŸ’œ


and that's the page!! this little cutie lives in the Library Functions Manual, filed under umult64(3) β€” mwah, no cap, go multiply responsibly πŸŽ€πŸ’–βœ¨