Skip to main content
Log in

Mojo function

atof

atof(str: String) -> SIMD[float64, 1]

Parses the given string as a floating point and returns that value.

For example, atof("2.25") returns 2.25.

Args:

  • str (String): A string to be parsed as a floating point.

Returns:

An floating point value that represents the string, or otherwise raises.

Raises:

If the given string cannot be parsed as an floating point value, for example in atof("hi").