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

Floating imprecision #52

Open
EliotVU opened this issue Sep 23, 2022 · 0 comments
Open

Floating imprecision #52

EliotVU opened this issue Sep 23, 2022 · 0 comments
Labels
bug decompiler Issues related to decompilation help wanted

Comments

@EliotVU
Copy link
Owner

EliotVU commented Sep 23, 2022

Floats are sometimes not formatted properly, especially if they have many decimals e.g.

Script: splashSize = 0.000025 * Mass * (250 - 0.5 * Velocity.Z);
Compiled->Decompiled to: splashSize = (2.5E-05 * Mass) * (float(250) - (0.5 * Velocity.Z));

The decompilation of floats is handled at PropertyDisplay

Solution: Changing the format to "F7" outputs 0.0000250, however this also outputs BobDamping=0.96 as BobDamping=0.9600000, using "G7" gives us a compact output, but it doesn't fix the first problem 👎🏻

Should we just strip the trailing zeros? Or is there a way to get the results of F7 in a compact form like G7?

EliotVU added a commit that referenced this issue Sep 26, 2022
@EliotVU EliotVU added the decompiler Issues related to decompilation label Jan 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug decompiler Issues related to decompilation help wanted
Projects
None yet
Development

No branches or pull requests

1 participant