From 335a5236e72b1d059fabfbfdd2ac13107aec4072 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Thu, 6 Nov 2008 15:48:36 -0800 Subject: add sys.float32bits, sys.float64bits R=rsc DELTA=21 (21 added, 0 deleted, 0 changed) OCL=18709 CL=18718 --- src/runtime/runtime.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/runtime/runtime.c') 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; -- cgit v1.3-5-g9baa