aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/float/float.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/float/float.c b/src/float/float.c
index 9520bea..e9e6700 100644
--- a/src/float/float.c
+++ b/src/float/float.c
@@ -229,6 +229,24 @@ int32_t rin_float_to_int(const float num)
return ret;
}
+float rin_uint_to_float(const uint32_t num)
+{
+ float ret;
+
+ memcpy(&ret, &num, sizeof(num));
+
+ return ret;
+}
+
+float rin_int_to_float(const int32_t num)
+{
+ float ret;
+
+ memcpy(&ret, &num, sizeof(num));
+
+ return ret;
+}
+
uint64_t rin_double_to_ulong(const double num)
{
uint64_t ret;
@@ -246,3 +264,21 @@ int64_t rin_double_to_long(const double num)
return ret;
}
+
+double rin_ulong_to_double(const uint64_t num)
+{
+ double ret;
+
+ memcpy(&ret, &num, sizeof(num));
+
+ return ret;
+}
+
+double rin_long_to_double(const int64_t num)
+{
+ double ret;
+
+ memcpy(&ret, &num, sizeof(num));
+
+ return ret;
+}