Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v test does not print float value #21536

Closed
TheOnlySilverClaw opened this issue May 20, 2024 · 2 comments · Fixed by #21538
Closed

v test does not print float value #21536

TheOnlySilverClaw opened this issue May 20, 2024 · 2 comments · Fixed by #21538
Assignees
Labels
Bug This tag is applied to issues which reports bugs. Unit: cgen Bugs/feature requests, that are related to the default C generating backend.

Comments

@TheOnlySilverClaw
Copy link

TheOnlySilverClaw commented May 20, 2024

Describe the bug

When asserting against a wrong f32 or f64 value, the output of v test show *unknown value* instead of the actual value.

Reproduction Steps

run v test on

pub fn test_format() {

	f := 0.2
	assert f == 0.1
}

Expected Behavior

   > assert f == f64(0.1)
     Left value: 0.2
    Right value: 0.1

Current Behavior

   > assert f == f64(0.1)
     Left value: 0.2
    Right value: *unknown value*

Possible Solution

No response

Additional Information/Context

No response

V version

0.4.5

Environment details (OS name and version, etc.)

V full version: V 0.4.5 c0afe5d.f33b712
OS: linux, Ubuntu 22.04.4 LTS
CC version: cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

@TheOnlySilverClaw TheOnlySilverClaw added the Bug This tag is applied to issues which reports bugs. label May 20, 2024
@felipensp felipensp self-assigned this May 20, 2024
@felipensp felipensp added the Unit: cgen Bugs/feature requests, that are related to the default C generating backend. label May 20, 2024
@TheOnlySilverClaw
Copy link
Author

If it makes your discussion about floating point comparison fundamentals any easier, the issue also occurs when using <,<=, >, or >=.

@JalonSolov
Copy link
Contributor

No argument that it needs to print an actual float instead of "unknown value".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs. Unit: cgen Bugs/feature requests, that are related to the default C generating backend.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants