Templat...n::Math(3)

๐ŸŽ€ NAME ๐ŸŽ€

okay bestie, welcome to Template::Plugin::Math(3) โ€” the header/footer smoosh it into Templat...n::Math(3) because truncation ate, but itโ€™s still her ๐Ÿ’…. This page lives under User Contributed Perl Documentation, and the plugin is literally the plugin providing mathematical functions. No cap. ๐Ÿ’–

โœจ SYNOPSIS โœจ

Like, the whole vibe check:

[% USE Math %]

[% Math.sqrt(9) %]

๐ŸŒธ DESCRIPTION ๐ŸŒธ

The Math plugin provides numerous mathematical functions for use within templates. Thatโ€™s the tea: you want math inside a template, this plugin hands it over. ๐Ÿงฎโœจ

๐Ÿ’… METHODS ๐Ÿ’…

Template::Plugin::Math makes available the following functions from the Perl core, in this exact order:

  • abs
  • atan2
  • cos
  • exp
  • hex
  • int
  • log
  • oct
  • rand
  • sin
  • sqrt
  • srand

And if the Math::Trig module can be loaded, these extra functions are also available โ€” same order, bestie:

  • pi
  • tan
  • csc
  • cosec
  • sec
  • cot
  • cotan
  • asin
  • acos
  • atan
  • acsc
  • acosec
  • asec
  • acot
  • acotan
  • sinh
  • cosh
  • tanh
  • csch
  • cosech
  • sech
  • coth
  • cotanh
  • asinh
  • acosh
  • atanh
  • acsch
  • acosech
  • asech
  • acoth
  • acotanh
  • rad2deg
  • rad2grad
  • deg2rad
  • deg2grad
  • grad2rad
  • grad2deg

If the Math::TrulyRandom module is available โ€” and, like, youโ€™ve got the time to wait โ€” the truly_random_number method is available:

[% Math.truly_random_number %]

๐Ÿฆ‹ AUTHOR ๐Ÿฆ‹

Andy Wardley <abw@wardley.org> <http://wardley.org/> โ€” iconic. ๐Ÿ’Œ

Copyright (C) 1996-2022 Andy Wardley. All Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Slay, but legally. ๐Ÿ’…

๐ŸŒˆ SEE ALSO ๐ŸŒˆ

Template::Plugin โ€” go peek, iykyk. ๐Ÿซถ

Byeee โ€” footer says perl v5.42.0, dated 2024-06-23. Mwah. ๐Ÿ’‹

๐Ÿ“ฆ where this page comes from