summaryrefslogtreecommitdiffstats
path: root/floatprops.h
diff options
context:
space:
mode:
Diffstat (limited to 'floatprops.h')
-rw-r--r--floatprops.h12
1 files changed, 0 insertions, 12 deletions
diff --git a/floatprops.h b/floatprops.h
index 3acd2d3..5d4dd24 100644
--- a/floatprops.h
+++ b/floatprops.h
@@ -189,18 +189,12 @@ namespace vecmathlib {
// Re-interpret bit patterns
static real_t as_float(int_t x)
{
- // return *(real_t*)&x;
- // union { int_t i; real_t r; } ir;
- // return ir.i=x, ir.r;
real_t res;
std::memcpy(&res, &x, sizeof res);
return res;
}
static int_t as_int(real_t x)
{
- // return *(int_t*)&x;
- // union { real_t r; int_t i; } ri;
- // return ri.r=x, ri.i;
int_t res;
std::memcpy(&res, &x, sizeof res);
return res;
@@ -250,18 +244,12 @@ namespace vecmathlib {
// Re-interpret bit patterns
static real_t as_float(int_t x)
{
- // return *(real_t*)&x;
- // union { int_t i; real_t r; } ir;
- // return ir.i=x, ir.r;
real_t res;
std::memcpy(&res, &x, sizeof res);
return res;
}
static int_t as_int(real_t x)
{
- // return *(int_t*)&x;
- // union { real_t r; int_t i; } ri;
- // return ri.r=x, ri.i;
int_t res;
std::memcpy(&res, &x, sizeof res);
return res;
OpenPOWER on IntegriCloud