-
-
Save doterik/b529113a92e37e306805d1c2359bc7ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class C | |
{ | |
void M() | |
{ | |
string s1 = "1" + "2" + "3"; | |
string s2 = "1" + (string)("2" + "3"); // dimmed - redundant | |
float f1 = 1f + 2f + 3f; | |
float f2 = 1f + (float)(2f + 3f); | |
float f3 = 1f + (float)(GetValue() + 3f); | |
int i1 = 1 + 2 + 3; | |
int i2 = 1 + (int)(2 + 3); // dimmed - redundant | |
double d1 = 1d + 2d + 3d; | |
double d2 = 1d + (double)(2d + 3d); | |
Console.Write($"{s1} {s2} {f1} {f2} {f3} {i1} {i2} {d1} {d2}"); | |
} | |
float GetValue() => 2f; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": 1, | |
"target": "IL", | |
"mode": "Release" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment