-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Naming of well known constants in C#, VB code (Math.PI instead of 3.1415926535897931) #517
Comments
This can get quite hard, because constants (and constant expressions, like |
@PoroCYon, I mean small part of most used combinations which can be added or calculated manually. I found following So, taking above result into consideration, I suppose to calculate pi coefficient by following way: Also descried above algorithm should be applied for constant I'll try to implement this feature. |
I analyzed most popular .net decompilers (JustDecompile, dotPeek, .NET Reflector) and found that only dotPeek supports this feature. |
@KvanTTT Did you notice if dotPeek really decompiled that or if it was using Microsoft's PDB servers (which is a built-in feature of dotPeek)? |
@dee-see dotPeek actually does do this. int i = 255; dotPeek (unlike others, obviously) decompiled it as: int i = byte.MaxValue; |
…sions containing Math.PI and Math.E as factors.
…iterals-pretty-print Pretty print floating point literals; fix icsharpcode#517; fix icsharpcode#1314
It would be good to convert double numbers to well know constants (such as Math.PI, Math.E) and their combinations (Math.PI * 2).
I mean decompile IL to:
instead of:
The text was updated successfully, but these errors were encountered: