.. efun:: int to_int(string) int to_int(float) int to_int(int) int to_int(closure) (int) Floats are truncated to integer values; strings with leading digits are converted to integers up to the first non-digit; lfun-closures are converted into their function index (not adjusted for inheritance); variable closure are converted into their variable index; integers are just returned. Regarding floats, it is important to keep rounding effects in mind: ``to_int(3.1*10.0)`` does not return ``31``, but instead ``30``, because internally the result of the multiplication is ``30.999999``. The function supports the ``0x``, ``0o`` and ``0b`` base prefixes. .. limit:: The cast notation only works if the precise type of is known at compile-time. This will not be fixed--use the function form instead. :history 3.2.1@2 introduced: :history 3.2.11/3.3.611 changed: added support for the base prefixes. .. seealso:: :efun:`to_string`, :efun:`sscanf`