# Sema: coerce comptime_float to fixed-width float · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/9af4cada73e43fb98e906a0ed79197963d1a05ac)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 9af4cada73e43fb98e906a0ed79197963d1a05ac

Requested commit: 9af4cada73e43fb98e906a0ed79197963d1a05ac

Commit: 9af4cada73e43fb98e906a0ed79197963d1a05ac

Tree: db634dec75b5f79847dbfa799b613d47815bc0cd

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

````
Sema: coerce comptime_float to fixed-width float

Instead of doing heterogeneous comparison at comptime. This makes the
following test pass (as it already does for stage1):

```zig
test {
    const x: f64 = 12.34;
    expect(x == 12.34);
}
```

There is already behavior test coverage for this, however, other bugs in
`std.fmt.parseFloat` are masking the failures.

From a language specification perspective, this makes sense because it
makes comptime comparisons with comptime_float work the same way they
work with runtime comparisons.

````

## Parents

- [a3f56154d08f25dbe2b6d15de30deda8a2d9ef33](https://git.cafe/gitcafe/zig/commit/a3f56154d08f25dbe2b6d15de30deda8a2d9ef33?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/9af4cada73e43fb98e906a0ed79197963d1a05ac?format=markdown)
