.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_float: float ===== **Category:** Built-In Types Brief Description ----------------- Float built-in type Member Functions ---------------- +----------------------------+--------------------------------------------------------------------------------+ | :ref:`float` | :ref:`float` **(** :ref:`bool` from **)** | +----------------------------+--------------------------------------------------------------------------------+ | :ref:`float` | :ref:`float` **(** :ref:`int` from **)** | +----------------------------+--------------------------------------------------------------------------------+ | :ref:`float` | :ref:`float` **(** :ref:`String` from **)** | +----------------------------+--------------------------------------------------------------------------------+ Description ----------- Float built-in type. Member Function Description --------------------------- .. _class_float_float: - :ref:`float` **float** **(** :ref:`bool` from **)** Cast a :ref:`bool` value to a floating point value, ``float(true)`` will be equals to 1.0 and ``float(false)`` will be equals to 0.0. .. _class_float_float: - :ref:`float` **float** **(** :ref:`int` from **)** Cast an :ref:`int` value to a floating point value, ``float(1)`` will be equals to 1.0. .. _class_float_float: - :ref:`float` **float** **(** :ref:`String` from **)** Cast a :ref:`String` value to a floating point value. This method accepts float value strings like `` '1.23' `` and exponential notation strings for its parameter so calling `` float('1e3') `` will return 1000.0 and calling `` float('1e-3') `` will return -0.001.