ichop

Syntax

int ichop(double number)

Arguments

number
Any double or float number.

Return

The truncated value as an integer.

Description

Returns the value of number truncated, towards 0.0, to an integral value, as an integer.

Example

%ffp

OnFilterStart:
{
  // Result of this should be 2  
  Info("Chopping 2.543 towards 0.0 gives %d", ichop(2.543));

  // Result of this should be -2
  Info("Chopping -2.345 towards 0.0 gives %d", ichop(-2.345));
}

See Also

chop, iceil, ifloor, iround, ipow