FixD

From SCAR Divi Manual
Revision as of 09:46, 28 June 2011 by Freddy (talk | contribs) (Created page with "==Definition== <source lang="scar" lines="false"> function FixD(Degrees: Extended): Extended; </source> ===Source=== <source lang="scar"> function FixD(Degrees: Extended): Exten...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Definition

function FixD(Degrees: Extended): Extended;

Source

function FixD(Degrees: Extended): Extended;
begin
  Result := Degrees mod 360;
  if Result < 0 then Inc(Result, 360);
end;

Availability

SCAR Divi 3.00 > Current

Description

Fixes an angle specified by Degrees in degrees by adding/subtracting 360 until the value is larger than or equals 0 and is smaller than or equals 360.

Example

begin
  WriteLn(FixD(25));
  WriteLn(FixD(385));
end.

Output:

25
25

See Also