double op1, op2;
op1 = 70;
op2 = 6;
double result = Math.IEEERemainder(op1, op2);
textBox1.Text = result.ToString();
Dies ergibt bei mir: "-2" statt "4"
Wo liegt der Fehler?
isidor2706
Hi,
IEEERemainder ist keine Modulo Operation. Siehe dazu auch:
https://msdn.microsoft.com/de-de/library/system.math.ieeeremainder.aspx
Wenn Du den Rest aus einer Modulo Operation haben willst, verwende das hier:
result = op1 % op2;
Siehe dazu:
https://msdn.microsoft.com/de-de/library/vstudio/h6zfzfy7.aspx
Gruß, Stefan Microsoft MVP - Visual Developer ASP/ASP.NET http://www.asp-solutions.de/ - Consulting, Development http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community