MCPcopy Create free account
hub / github.com/ARM-software/astc-encoder / float_as_uint

Function float_as_uint

Source/astcenc_mathlib.h:383–389  ·  view source on GitHub ↗

* @brief SP float bit-interpreted as an unsigned integer. * * @param v The value to bitcast. * * @return The converted value. */

Source from the content-addressed store, hash-verified

381 * @return The converted value.
382 */
383static inline unsigned int float_as_uint(float v)
384{
385 // Future: Can use std:bit_cast with C++20
386 unsigned int iv;
387 std::memcpy(&iv, &v, sizeof(float));
388 return iv;
389}
390
391/**
392 * @brief Unsigned integer bit-interpreted as an SP float.

Callers 2

float_to_sf16Function · 0.85
frexpFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected