| author | |
| committer | |
| log | b18b4db7095f58b1e8b3f5ac4993bda38231c2af |
| tree | 2528a0366a59fe95e5e562bbe385dda78caa9a6d |
| parent | 5a3eca5d4ca42f92abe60040e21ffd8e307d8466 |
| signature |
Co-authored-by: Ryan Liptak <squeek502@hotmail.com>1 files changed, 8 insertions(+), 0 deletions(-)
lib/std/fmt/parse_float/parse_float.zig+8| ... | ... | @@ -12,6 +12,14 @@ pub const ParseFloatError = error{ |
| 12 | 12 | }; |
| 13 | 13 | |
| 14 | 14 | pub fn parseFloat(comptime T: type, s: []const u8) ParseFloatError!T { |
| 15 | if (@typeInfo(T) != .Float) { | |
| 16 | @compileError("Cannot parse a float into a non-floating point type."); | |
| 17 | } | |
| 18 | ||
| 19 | if (T == f80) { | |
| 20 | @compileError("TODO support parsing float to f80"); | |
| 21 | } | |
| 22 | ||
| 15 | 23 | if (s.len == 0) { |
| 16 | 24 | return error.InvalidCharacter; |
| 17 | 25 | } |