Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int speed1 = (int)(6.2f * 10);
- float tmp = 6.2f * 10;
- int speed2 = (int)tmp;
- speed1 = 61
- speed2 = 62
- IL_01b3: ldloc.s V_8
- IL_01b5: callvirt instance float32 myPackage.MyClass::getSpeed()
- IL_01ba: ldc.r4 10.
- IL_01bf: mul
- IL_01c0: conv.i4
- IL_01c1: stloc.s V_9
- IL_01c3: ldloc.s V_8
- IL_01c5: callvirt instance float32 myPackage.MyClass::getSpeed()
- IL_01ca: ldc.r4 10.
- IL_01cf: mul
- IL_01d0: stloc.s V_10
- IL_01d2: ldloc.s V_10
- IL_01d4: conv.i4
- IL_01d5: stloc.s V_11
- double d = 6.2f * 10;
- int tmp2 = (int)d;
- // evaluate tmp2
- DoubleConverter.ToExactString((6.2f * 10))
- // output 61.9999980926513671875
- IL_0000: ldc.i4.s 3D // speed1 = 61
- IL_0002: stloc.0
- IL_0003: ldc.r4 00 00 78 42 // tmp = 62.0f
- IL_0008: stloc.1
- IL_0009: ldloc.1
- IL_000A: conv.i4
- IL_000B: stloc.2
- int speed1 = (int)(6.2f * 10);
- mov dword ptr [rbp+8],3Dh //result is precalculated (61)
- float tmp = 6.2f * 10;
- movss xmm0,dword ptr [000004E8h] //precalculated (float format, xmm0=0x42780000 (62.0))
- movss dword ptr [rbp+0Ch],xmm0
- int speed2 = (int)tmp;
- cvttss2si eax,dword ptr [rbp+0Ch] //instrunction converts float to Int32 (eax=62)
- mov dword ptr [rbp+10h],eax
- Int32 speed0 = (Int32)(6.2f * 100000000);
- int speed1 = (int)(6.2f * 10)
- int speed1 = Int.Parse((6.2f * 10).ToString());
- int speed1 = (int)(6.2f * 10);//61
- double speed2 = (6.2f * 10);//61.9999980926514
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement