summaryrefslogtreecommitdiff
path: root/src/lib/runtime/float_go.cgo
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-06-06 22:04:39 -0700
committerRuss Cox <rsc@golang.org>2009-06-06 22:04:39 -0700
commit8257be5f9d4a4bdbb0ff096756a0e48401d620c8 (patch)
tree1195452c472b99bfd365ee1cc057e870178e63e0 /src/lib/runtime/float_go.cgo
parentaf9643dcc1336bcb6e6ed0817e68a9c2db2c5613 (diff)
downloadgolang-8257be5f9d4a4bdbb0ff096756a0e48401d620c8.tar.gz
move src/runtime -> src/lib/runtime;
only automatic g4 mv here. R=r OCL=30002 CL=30007
Diffstat (limited to 'src/lib/runtime/float_go.cgo')
-rw-r--r--src/lib/runtime/float_go.cgo52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/lib/runtime/float_go.cgo b/src/lib/runtime/float_go.cgo
new file mode 100644
index 000000000..518d55950
--- /dev/null
+++ b/src/lib/runtime/float_go.cgo
@@ -0,0 +1,52 @@
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package math
+
+#include "runtime.h"
+
+func Frexp(f float64) (frac float64, exp int32) {
+ frac = frexp(f, &exp);
+}
+
+func Ldexp(frac float64, exp int32) (f float64) {
+ f = ldexp(frac, exp);
+}
+
+func Modf(f float64) (integer float64, frac float64) {
+ frac = modf(f, &integer);
+}
+
+func IsInf(f float64, sign int32) (is bool) {
+ is = isInf(f, sign);
+}
+
+func IsNaN(f float64) (is bool) {
+ is = isNaN(f);
+}
+
+func Inf(sign int32) (f float64) {
+ f = Inf(sign);
+}
+
+func NaN() (f float64) {
+ f = NaN();
+}
+
+func Float32bits(f float32) (b uint32) {
+ b = float32tobits(f);
+}
+
+func Float64bits(f float64) (b uint64) {
+ b = float64tobits(f);
+}
+
+func Float32frombits(b uint32) (f float32) {
+ f = float32frombits(b);
+}
+
+func Float64frombits(b uint64) (f float64) {
+ f = float64frombits(b);
+}
+