| 1 | package Bio::GMOD::Blast::Graph::MyMath; | ||
| 2 | BEGIN { | ||
| 3 | $Bio::GMOD::Blast::Graph::MyMath::AUTHORITY = 'cpan:RBUELS'; | ||
| 4 | } | ||
| 5 | BEGIN { | ||
| 6 | $Bio::GMOD::Blast::Graph::MyMath::VERSION = '0.06'; | ||
| 7 | } | ||
| 8 | ##################################################################### | ||
| 9 | # | ||
| 10 | # Cared for by Shuai Weng <shuai@genome.stanford.edu> | ||
| 11 | # | ||
| 12 | # Originally created by John Slenk <jces@genome.stanford.edu> | ||
| 13 | # | ||
| 14 | # You may distribute this module under the same terms as perl itself | ||
| 15 | #----------------------------------------------------------------- | ||
| 16 | |||
| 17 | require Exporter; | ||
| 18 | @ISA = qw( Exporter ); | ||
| 19 | @EXPORT_OK = qw( max round floor ceil ); | ||
| 20 | |||
| 21 | sub max | ||
| 22 | { | ||
| 23 | my( $a, $b ) = @_; | ||
| 24 | |||
| 25 | return( ($a > $b) ? $a : $b ); | ||
| 26 | } | ||
| 27 | |||
| 28 | sub round | ||
| 29 | { | ||
| 30 | my( $float ) = shift; | ||
| 31 | return( int($float+0.5) ); | ||
| 32 | } | ||
| 33 | |||
| 34 | sub floor | ||
| 35 | { | ||
| 36 | my( $float ) = shift; | ||
| 37 | return( int($float) ); | ||
| 38 | } | ||
| 39 | |||
| 40 | sub ceil | ||
| 41 | { | ||
| 42 | my( $float ) = shift; | ||
| 43 | return( int($float+0.5) ); | ||
| 44 | } | ||
| 45 | |||
| 46 | 1; | ||
| 47 | |||
| 48 | |||
| 49 | __END__ |