.. highlightlang:: us .. _cast: cast ==== .. index:: cast .. us.tag cast GERMAN New5140 :ref:`cast` führt eine C-cast-Operation durch, z. B. ``r = (double)(float) m``. .. function:: r = cast(m, nType) .. us.return **Returnwert** *r* ist eine real-Matrix. .. us.params **Parameter** .. uparam:: m *m* ist eine real-Matrix. .. uparam:: nType *nType* ist einer der folgenden Werte: .. list-table:: :header-rows: 0 * - CAST_INT8 (0) * - CAST_UINT8 (1) * - CAST_INT16 (2) * - CAST_UINT16 (3) * - CAST_INT32 (4) * - CAST_UINT32 (5) * - CAST_INT64 (6) * - CAST_UINT64 (7) * - CAST_FLOAT (8) * - CAST_FLOAT_STAR (9) ``int i = (int) m; r = (double)*(float*) &i`` .. us.example **Beispiel** :: * cast(500, CAST_INT8) -12.0000 * cast(500, CAST_UINT8) 244.0000 * cast(500, CAST_UINT16) 500.0000 * cast(1130332544, CAST_FLOAT_STAR) 223.5059 .. seealso:: :ref:`uberblick-mathematik`, :ref:`ceil`, :ref:`floor`, :ref:`int` :sub:`id-1438918`