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$objectwithout 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$objectin pixels π₯ and heads up: it uses the state variableDPI(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$objector$other, whichever is smaller. the humble one wins π$n = $object->larger($other);β returns$objector$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:-1for negatives,0for 0 and1for 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$objectand$other. friendship math π€$n = $object->subtract($other);β returns an object representing the difference between$objectand$other. the difference, get it, I'm so funny π$n = $object->multiply($n);β returns an object representing the product of$objectand$n(a regular number). oh, and$nhere is literally a regular number, not being weird about it π$n = $object->divide($n);β returns an object representing the (truncating) division of$objectby$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$objectby$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 π
β COPYRIGHT β
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
- ubuntu resolute: latexml 0.8.8-4 Β· PD
- ubuntu stonking: latexml 0.8.8-4 Β· PD
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms