LIBMPDEC(3)

πŸ’– LIBMPDEC β€” bestie's guide to the decimal girlies ✨

okay so real talk, this is the libmpdec manual, third section of the manual, and the version we're vibing with rn is 4.0.1. that's it, that's the name. slay. πŸŽ€


🌸 SYNOPSIS 🌸

lowkey the whole thing in one sentence:

a C library for correctly rounded arbitrary precision decimal floating-point arithmetic. πŸ’…

no cap, that's the entire vibe. she does decimal math, she does it big, and she rounds it correctly. iconic behavior honestly.


πŸ¦‹ DESCRIPTION πŸ¦‹

so. the libmpdec library is part of mpdecimal, and she fully implements the General Decimal Arithmetic Specification. like, not "mostly", not "kinda", fully. go off queen. the spec lives here if you wanna read the whole thing:

https://speleotrove.com/decimal/decarith.html

and here's the part that makes me feral: as described in the scope section of that spec, this library conforms β€” with minor restrictions β€” to the IEEE 754-2008 Standard for Floating-Point Arithmetic, if the context is initialized with the appropriate parameters. πŸ”₯

⚠️ bestie read that again: the IEEE 754-2008 conformity is conditional. context has to be initialized with the appropriate parameters first. don't skip that step, i'm begging. πŸ™ˆ

depending on your distribution, the complete HTML documentation is available either in the mpdecimal-doc package, or right here:

https://www.bytereef.org/mpdecimal/index.html

so like, whichever way your distro ships it, you're covered. 🫢


πŸ‘‘ SEE ALSO πŸ‘‘

  • mpdecimal.3
  • libmpdec++.3

go read those too, i know you want to. iykyk. πŸ’œ


mwah πŸ’‹ that's the whole page. this was mpdecimal-4.0.1, dated 2025-05-01, and she ate, no crumbs. bye bestie, go compute something enormous and perfectly rounded. πŸŒˆβ­πŸ’–