```{index} single: strtod; POSIX function ``` ```{index} single: POSIX::strtod; Perl function ``` # strtod Parse a double from the start of a string, locale-aware. ## Synopsis ```perl use POSIX qw(strtod); my ($num, $unparsed) = strtod("3.14abc"); # (3.14, 3) ``` ## What you get back A two-element list: the parsed value and the number of bytes that did not form part of the number. When `$unparsed == 0`, the whole string was consumed. ## Edge cases - Input that doesn't start with a number: returns `(0, length)`. - Overflow: returns `HUGE_VAL` and sets `$!` to `ERANGE`. ## Differences from upstream Fully compatible with upstream POSIX. ## See also - `strtol`, `strtoul` — integer variants.