parse

Parses a character range to a floating point number.

Parameters

Target

a floating point type

source Source

the lvalue of the range to parse

Return Value

Type: Target

A floating point number of type Target

Throws

A ConvException if source is empty, if no number could be parsed, or if an overflow occurred.

Examples

import std.math : approxEqual;
auto str = "123.456";

assert(parse!double(str).approxEqual(123.456));

Meta

Suggestion Box / Bug Report