Template::Plugin::Math
Author: Andy Wardley

TT2 Home Page

- Modules
- Template::*
- Plugin::*
- Math.pm

Click to view the menu. It's very nice. Click to hide the menu and go all widescreen!
Back

#### Template::Plugin::Iterator

Plugin to create iterators (Template::Iterator) Up

#### Template::Plugin::* Modules

Next

#### Template::Plugin::Pod

Plugin interface to Pod::POM (Pod Object Model)

# Template::Plugin::Math

## Plugin providing mathematical functions

# Contents

Top

# SYNOPSIS

Top

    [% USE Math %]

    [% Math.sqrt(9) %]

# DESCRIPTION

Top

The Math plugin provides numerous mathematical functions for use within templates.

# METHODS

Top

`Template::Plugin::Math` makes available the following functions from the Perl core:

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

In addition, if the Math::Trig module can be loaded, the following functions are also available:

- 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 you've got the time to wait, the `truly_random_number` method is available:

    [% Math.truly_random_number %]

# AUTHOR

Top

Andy Wardley <abw@wardley.org> http://wardley.org/

# COPYRIGHT

Top

Copyright (C) 1996-2007 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.

# SEE ALSO

Top

Template::Plugin

http://template-toolkit.org/docs/modules/Template/Plugin/Math.html