LaTeXM...:Number(3pm)

πŸ’… NAME πŸ’…

okay so bestie, let me introduce you to LaTeXML::Common::Number β€” it's the whole representation-of-numbers situation, and yes, it extends LaTeXML::Common::Object (so it's got that Object main character energy, iykyk). This is page LaTeXML::Common::Number(3pm) from the User Contributed Perl Documentation, and it's lowkey iconic ✨


πŸŽ€ Exported functions πŸŽ€

  • $number = Number($num); β€” literally creates a Number object that represents $num. that's it, that's the function, she's simple and she slays 🫢

🌸 Methods 🌸

  • @tokens = $object->unlist; β€” hands you back a list of the tokens that make up this $object. giving inventory πŸ’…
  • $string = $object->toString; β€” returns a string representing $object. the classic toString moment, no cap ✨
  • $string = $object->ptValue; β€” returns a value representing $object without the measurement unit (pt), and it's got limited decimal places. so like, the pt is not invited to this party πŸ™ˆ
  • $string = $object->pxValue; β€” returns an integer value representing $object in pixels πŸ”₯ and heads up: it uses the state variable DPI (dots per inch), so that's a whole thing you should know about, fr fr
  • $n = $object->valueOf; β€” returns the value in scaled points (ignoring shrink and stretch, if any). shrink and stretch are just vibing in the corner, not part of the math πŸ’€
  • $n = $object->smaller($other); β€” returns $object or $other, whichever is smaller. the humble one wins πŸŽ€
  • $n = $object->larger($other); β€” returns $object or $other, whichever is larger. big energy only πŸ‘‘
  • $n = $object->absolute; β€” returns an object representing the absolute value of the $object. negatives get therapy and come back positive πŸ’–
  • $n = $object->sign; β€” returns an integer: -1 for negatives, 0 for 0 and 1 for positives. three moods, pick one πŸ¦‹
  • $n = $object->negate; β€” returns an object representing the negative of the $object. flip it, reverse it, periodt 🌈
  • $n = $object->add($other); β€” returns an object representing the sum of $object and $other. friendship math 🀝
  • $n = $object->subtract($other); β€” returns an object representing the difference between $object and $other. the difference, get it, I'm so funny 😭
  • $n = $object->multiply($n); β€” returns an object representing the product of $object and $n (a regular number). oh, and $n here is literally a regular number, not being weird about it πŸ’…
  • $n = $object->divide($n); β€” returns an object representing the (truncating) division of $object by $n (a regular number). truncating!! she cuts the decimals off and doesn't look back βœ‚οΈ
  • $n = $object->divideround($n); β€” returns an object representing the (rounding) division of $object by $n (a regular number). this one rounds instead of truncating, so pick your fighter πŸ₯Š

πŸ‘‘ AUTHOR πŸ‘‘

Bruce Miller <bruce.miller@nist.gov> β€” we stan a legend πŸ’œ


Public domain software, produced as part of work done by the United States Government & not subject to copyright in the US. so go off, it's free, no cap πŸŽ€


okay that's the whole page bestie, we ate and left no crumbs πŸ“ β€” this was perl v5.40.1, dated 2025-11-16, and the page is LaTeXML::Common::Number(3pm). mwah πŸ’–

πŸ“¦ where this page comes from