imult32(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

πŸ’– imult32(3) β€” integer multiplication with overflow checking πŸ’–

ok so bestie, welcome to the imult32(3) page from the Library Functions Manual ✨ this is the safe little multiplication baddie, and she is not about to let your integers just silently overflow like some chaotic mess. nope. we do math, but we do it responsibly. periodt. πŸŽ€


✨ SYNTAX ✨

#include <libowfat/safemult.h>

int imult32(int32 a,int32 b,int32* c);

like yes, that's it, that's the whole vibe check πŸ¦‹ one include, one function, zero drama.


🌸 DESCRIPTION 🌸

so what she does is: imult32 does c=a*b and returns 1. literally just multiplies two int32s and drops the answer into whatever c is pointing at. slay. πŸ’…

and then the important part, the main character moment: in case of an integer overflow, imult32 leaves c alone and returns 0. πŸ›‘

okay that "leaves c alone" part is NOT a drill β€” she does not touch it, does not write a garbage wrapped value into it, does not do a little surprise. your c stays exactly how you left it. 🫢

πŸ¦‹ SEE ALSO πŸ¦‹

go read those too, bestie, they're the whole friend group πŸ’œπŸŒˆ


and that's the whole page πŸ’– this was imult32(3) from the Library Functions Manual β€” stay safe out there, keep your multiplications checked, ily, bye πŸ‘‘βœ¨