abs_diff(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– abs_diff(9) β€” Kernel API Manual πŸ’–

okay so bestie, welcome to the abs_diff page ✨ it's short, it's sweet, it's literally just math but make it kernel. let's get into it πŸŽ€


🌸 NAME 🌸

abs_diff β€” return the absolute value of the difference between the arguments πŸ’…


✨ SYNOPSIS ✨

abs_diff (a , b );

yes that's the whole thing. no cap, it's giving minimalism πŸ‘‘


🫢 ARGUMENTS 🫢

  • a β€” the first argument 🌈
  • b β€” the second argument πŸ¦‹

πŸ’œ DESCRIPTION πŸ’œ

okay so here's the vibe check: a and b have to be of the same type. like, that's not optional, that's the rule πŸ™ˆ with that restriction in place, we compare signed to signed and unsigned to unsigned β€” fr fr, no mixing, it's not that kind of function πŸ’€

the result is the subtraction of the smaller of the two from the bigger, hence the result is always a positive value ✨ so like, whichever one is smaller just gets yeeted out of the bigger one, and you always come out with something positive. iconic behavior honestly 🌟


⭐ RETURN ⭐

an absolute value of the difference between a and b πŸ’–


πŸ¦‹ SEE ALSO πŸ¦‹

kernel file ./include/linux/math.h β€” and bestie, please go say hi to the whole math.h friend group, they're all so sweet:


and that's the page!! πŸŽ€ mwah πŸ’‹

little sign-off from your girl: this one lives in ./include/linux, dated October 2026 β€” that's the source and the version-date situation, and yes i remembered it for you πŸ«ΆπŸ’œ
πŸ“¦ where this page comes from