NAME
Getopt::Pad::Type::Float - The float option type
SYNOPSIS
options => {
ratio => { type => 'float', min => 0, max => 1, default => 0.5 },
},
DESCRIPTION
The type of options and args declared with type => 'float', 'num', 'number' or 'f'.
It accepts any value that Perl recognizes as a decimal number ("looks_like_number" in Scalar::Util): 1.5, -2, .5, 1e3. Values that are not finite are rejected with 'VALUE' is not a finite number: inf, infinity and nan in any spelling, and values too large for a Perl number, such as 1e999. Everything else that is not a number, including hexadecimal values such as 0x10, is rejected with 'VALUE' is not a number. The reader returns the value as a number.
The spec keys min and max set inclusive bounds; they come from Getopt::Pad::Type::Number. See "float" in Getopt::Pad for the user-level description.
SEE ALSO
"TYPES" in Getopt::Pad, Getopt::Pad::Type::Int, Getopt::Pad::Type::Number
AUTHOR
davenonymous <perl@davenonymous.com>
COPYRIGHT AND LICENSE
Copyright 2026 davenonymous
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.