UCS::Expression::Func - Utility functions for UCS expressions
use UCS::Expression::Func; $min_x = min($x1, $x2, ...); # minimum of two or more values $max_y = max(@y); # maximum of two or more values $log_prob = -log10($prob); # base 10 logarithm $log_prob = inf() # replace log(Infinity) = -log(0) if $prob == 0; # by a very large value
This module provides a collection of simple but useful functions, which are automatically imported into the UCS::Expression namespace so that they can be used in UCS expressions without full qualification.
Minimum of two or more numbers. The argument could also be an array
Maximum of two or more numbers. The argument could also be an array
Base 10 logarithm, which is used for all logarithmic scales in UCS (especially logarithmic p-values). Returns
-inf() if $prob is zero or negative.
The inf function returns a large positive floating-point value that represents the logarithm of Infinity in UCS/Perl. Note that the logarithm of 0 should consequently be represented by
-inf(), as does the log10 function. In order to find out the exact value on your system, you can use the command line
ucs-config -e 'print inf(),"\n"'
Copyright 2004 Stefan Evert.
This software is provided AS IS and the author makes no warranty as to its use and performance. You may use the software, redistribute and modify it under the same terms as Perl itself.