blob: d0bd177c8d7eaba3955b9b22e81d04b76960c4b6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#include <stdint.h>
#include "platform.h"
#include "primitives.h"
#include "internals.h"
#include "softfloat.h"
float64_t ui32_to_f64( uint_fast32_t a )
{
uint_fast64_t uiZ;
int shiftCount;
union ui64_f64 uZ;
if ( ! a ) {
uiZ = 0;
} else {
shiftCount = softfloat_countLeadingZeros32( a ) + 21;
uiZ =
packToF64UI(
0, 0x432 - shiftCount, (uint_fast64_t) a<<shiftCount );
}
uZ.ui = uiZ;
return uZ.f;
}
|