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

Use alternative format string specifier to ensure decimal point is present #111254

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

jkoritzinsky
Copy link
Member

After this change, ildasm will generate the following:

.class public abstract auto ansi sealed beforefieldinit Program
       extends [System.Runtime]System.Object
{
  .field public static literal float64 ValueDoubleOne = float64(1.0000000000000000)
  .field public static literal float64 ValueDoubleOnePointTwo = float64(1.2000000000000000)
  .field public static literal float64 ValueDoubleMinusOne = float64(-1.0000000000000000)
  .field public static literal float64 ValueDoubleMinusZero = float64(-0.0000000000000000)
  .field public static literal float32 ValueFloatOne = float32(1.0000000)
  .field public static literal float32 ValueFloatOnePointTwo = float32(1.2000000)
  .field public static literal float32 ValueFloatMinusOne = float32(-1.0000000)
  .field public static literal float32 ValueFloatMinusZero = float32(-0.0000000)
} // end of class Program

Fixes #111014

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

The insignificant zeros do not look great, but I assume that we do not care enough to strip them.

@jkoritzinsky jkoritzinsky merged commit 73bcb1d into dotnet:main Jan 15, 2025
83 of 89 checks passed
@jkoritzinsky
Copy link
Member Author

Yeah I think given the small number of ildasm users, it's fine. We can clean it up in the a future PR.

@jkoritzinsky
Copy link
Member Author

/backport to release/9.0-staging

Copy link
Contributor

Started backporting to release/9.0-staging: https://github.com/dotnet/runtime/actions/runs/12780296814

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ILDasm regression in relation to double (float64) and float (float32) values
2 participants