aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/runtime.c
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2008-11-06 15:48:36 -0800
committerRob Pike <r@golang.org>2008-11-06 15:48:36 -0800
commit335a5236e72b1d059fabfbfdd2ac13107aec4072 (patch)
treeaa83e7ec3d1f1b32db2424172b255fdc8aae8094 /src/runtime/runtime.c
parentce15158502dad699a4781908a2fb0bed1dc8b61b (diff)
downloadgo-335a5236e72b1d059fabfbfdd2ac13107aec4072.tar.xz
add sys.float32bits, sys.float64bits
R=rsc DELTA=21 (21 added, 0 deleted, 0 changed) OCL=18709 CL=18718
Diffstat (limited to 'src/runtime/runtime.c')
-rw-r--r--src/runtime/runtime.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/runtime/runtime.c b/src/runtime/runtime.c
index db31b77df3..a0d97dcda9 100644
--- a/src/runtime/runtime.c
+++ b/src/runtime/runtime.c
@@ -347,6 +347,23 @@ sys·NaN(float64 out)
FLUSH(&out);
}
+// func float32bits(float32) uint32; // raw bits of float32
+void
+sys·float32bits(float32 din, uint32 iou)
+{
+ iou = *(uint32*)&din;
+ FLUSH(&iou);
+}
+
+// func float64bits(float64) uint64; // raw bits of float64
+void
+sys·float64bits(float64 din, uint64 iou)
+{
+ iou = *(uint64*)&din;
+ FLUSH(&iou);
+}
+
+
static int32 argc;
static uint8** argv;
static int32 envc;