Sign in Join
FPDoc Onlineexperiment

Tan function

In unit Math

Return tangent.

Declaration

pascal
function Tan(x: Float): Float

Description

Tan returns the tangent of x. The argument x must be in radians.

Errors

If x (normalized) is pi/2 or 3pi/2 then an overflow will occur.

See also

Example: ex47

pascal
Program Example47;

{ Program to demonstrate the Tan function. }

Uses math;

Procedure DoTan(Angle : Float);

begin
  Write('Angle : ',RadToDeg(Angle):8:6);
  Writeln(' Tangent : ',Tan(Angle):8:6);
end;

begin
  DoTan(0);
  DoTan(Pi);
  DoTan(Pi/3);
  DoTAn(Pi/4);
  DoTan(Pi/6);
end.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.