#pasfunction Floor(const X: Extended): Integer;begin Result := Integer(Trunc(X)); if Frac(X) < 0 then Dec(Result);end;