Implementation
C

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating resource.

Please try to avoid dependencies to third-party libraries and frameworks.

Other implementations
int y = (int)x;
y = x.to_i
y = trunc(x)
int y = cast(int)x;
y = truncate x
let y = x as i32;
var
  y: integer;
  x: single = -0.8;
begin
  y := trunc(x);
end;
int y = x.toInt()
y = int(x)
y := int(x)
my $y = int($x);
$y = (int)$x;
y = math.modf(x)