code VB.NET:Pourquoi ce code renvoie-t-il des valeurs différentes? (C# et VB.NET)
Module Module1
Sub Main()
Dim x, y As Single
x = 0 + (512/2 - 407)/256 * 192 * -1
y = 0 + (512/2 - 474)/256 * 192
Console.WriteLine(x.ToString + ": " + y.ToString)
Console.ReadLine()
End Sub
End Module
retour: 113,25: -163,5
C# Code:
class Program
{
static void Main(string[] args)
{
float x, y;
x = 0 + (512/2 - 407)/256 * 192 * -1;
y = 0 + (512/2 - 474)/256 * 192;
Console.WriteLine(x + ": " + y);
Console.ReadLine();
}
}
retours 0: 0
Je ne comprends pas, j'apprécierais une explication.
Merci pour votre aide. – tryingit
Vous êtes les bienvenus! –