Einzelnen Beitrag anzeigen

Andreas13

Registriert seit: 14. Okt 2006
Ort: Nürnberg
711 Beiträge
 
Delphi XE5 Professional
 
#10

AW: Probleme mit atan/atan2

  Alt 26. Mai 2019, 16:43
Hallo Felix,
etwas professioneller geht es so:
Delphi-Quellcode:
Function ArithRound(x: Extended): Int64;
Begin
  IF Frac(x) < 0.5 Then
    Result:= Floor(x)
  Else
    Result:= Ceil(x);
End;{ArithRound}
{--------------}
oder
Delphi-Quellcode:
Function ArithRound(x: Extended): Int64;
Begin
  Result:= Trunc(x + 0.5);
End;{ArithRound}
{--------------}
Gruß
Andreas

Geändert von Andreas13 (26. Mai 2019 um 16:45 Uhr)
  Mit Zitat antworten Zitat