Sometimes you need the angles to be represented only between 0..360, you probably seen functions like this one:

Code:
function OLDclamp360(angle: single): single;
begin
  Result := angle;

  while Result <0> 360 do
    Result &#58;= Result - 360;

end;
Not only it's a bad code with a lot of branching that gets slower the bigger / smaller the numbers are, but there is a better / proper way:

Code:
function clamp360&#40;angle&#58; single&#41;&#58; single;
begin
  Result &#58;= angle;

  if result > 360 then result&#58;= result - &#40;round&#40;result&#41; div 360 * 360&#41;;
  if result < 0   then result&#58;= 360 + result - &#40;round&#40;result&#41; div 360 * 360&#41;;

end;