Skip to content

std.fmt.parseFloat treats "." as valid float. #11713

@ghost

Description

Zig Version

0.10.0-dev.1933+5f2d0d414

Steps to Reproduce

const std = @import("std");

test "" {
    const f = try std.fmt.parseFloat(f64, ".");
    try std.testing.expect(f == 0);
}

$ zig build test

Expected Behavior

I would expect this test to fail at the parseFloat call.

Actual Behavior

$ All 1 tests passed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorcontributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.standard libraryThis issue involves writing Zig code for the standard library.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions