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

Function float_as_int

Source/astcenc_mathlib.h:353–359  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

351 * @return The converted value.
352 */
353static inline int float_as_int(float v)
354{
355 // Future: Can use std:bit_cast with C++20
356 int iv;
357 std::memcpy(&iv, &v, sizeof(float));
358 return iv;
359}
360
361/**
362 * @brief Integer bit-interpreted as an SP float.

Callers 5

change_signFunction · 0.70
log2Function · 0.70
clzFunction · 0.70
unorm16_to_sf16Function · 0.70
frexpFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected