Normalize number within specified range
Perl
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib/Math/Normalize
t
xt
.gitignore
.shipit
Changes
MANIFEST
MANIFEST.SKIP
Makefile.PL
README
README.pod

README.pod

NAME

Math::Normalize::Range - Normalize within specified range

SYNOPSIS

use Math::Normalize::Range;

my $num = Math::Normalize::Range->new(
    target_min => 1000, target_max => 10000
);

$num->normalize(10, {min => 5, max => 20});

DESCRIPTION

Math::Normalize::Range normalizes number to specified range Default range is 0.0 .. 1.0. You can normalize any range.

METHOD

Class Method

Math::Normalize::Range->new(%args)

%args is:

target_min

Target minimum number. Default is 0.

target_max

Target maximum number. Default is 1.

Instance Method

$number->normalize($num, {min => $min, max => $max})

Normalize $num in range($min..$max) to target range.

AUTHOR

Syohei YOSHIDA <syohex@gmail.com>

COPYRIGHT

Copyright 2012- Syohei YOSHIDA

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO