Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
i32_to_f32.c File Reference
#include <stdbool.h>
#include <stdint.h>
#include "platform.h"
#include "internals.h"
#include "softfloat.h"
Include dependency graph for i32_to_f32.c:

Go to the source code of this file.

Functions

float32_t i32_to_f32 (int32_t a)
 

Function Documentation

◆ i32_to_f32()

float32_t i32_to_f32 ( int32_t a)

Definition at line 43 of file i32_to_f32.c.

44{
45 bool sign;
46 union ui32_f32 uZ;
47 uint_fast32_t absA;
48
49 sign = (a < 0);
50 if ( ! (a & 0x7FFFFFFF) ) {
51 uZ.ui = sign ? packToF32UI( 1, 0x9E, 0 ) : 0;
52 return uZ.f;
53 }
54 absA = sign ? -(uint_fast32_t) a : (uint_fast32_t) a;
55 return softfloat_normRoundPackToF32( sign, 0x9C, absA );
56
57}
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
float32_t softfloat_normRoundPackToF32(bool, int_fast16_t, uint_fast32_t)
#define packToF32UI(sign, exp, sig)
Definition internals.h:107
uint32_t uint_fast32_t
Definition stdint.h:156
Here is the call graph for this function:
Here is the caller graph for this function: