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

✨ imult16 ✨

okay so bestie, welcome to imult16 β€” she's a lil function from the Library Functions Manual and she does integer multiplication with overflow checking πŸ’– like yes she multiplies but she's ALSO the friend who checks on you first, iconic behavior tbh.


🌸 NAME 🌸

imult16 β€” integer multiplication with overflow checking πŸ’…


πŸŽ€ SYNTAX πŸŽ€

okay so first you gotta invite her in:

#include <libowfat/safemult.h>

int imult16(int16 a,int16 b,int16* c);

no cap, that's the whole vibe. three int16s and she's ready to go πŸ¦‹


🧚 DESCRIPTION 🧚

so here's the tea β˜• β€” imult16 does c=a*b and returns 1. that's it, that's the whole main character moment, she ate πŸ’…βœ¨

but wait, the plot twist: in case of an integer overflow, imult16 leaves c alone and returns 0 😭🫢

bestie pay attention: she does NOT touch c when it overflows. she just says "nope" and hands you a 0. your pointer's contents stay exactly how you left them. no chaos, no drama, she's respectful like that πŸ™ˆ

🌈 SEE ALSO 🌈

  • umult16(3) β€” her unsigned bestie πŸ’œ
  • imult32(3) β€” the 32-bit sister ✨
  • imult64(3) β€” the 64-bit big sister, highkey the same energy πŸ‘‘

and that's the whole page, fr fr πŸ“ it came from the Library Functions Manual, the page is imult16(3), and ngl there's no version or date printed down there β€” just her name, chillin' at the bottom like the queen she is πŸ‘‘πŸ’– mwah, go multiply something safely bestie πŸ¦‹