Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3314)

Unified Diff: f32/f32.go

Issue 141440043: code review 141440043: go.mobile/f32: float32 math library (Closed)
Patch Set: diff -r 547bbce45af3444f8b5d9a209501de569c9fd460 https://code.google.com/p/go.mobile Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | f32/f32_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: f32/f32.go
===================================================================
new file mode 100644
--- /dev/null
+++ b/f32/f32.go
@@ -0,0 +1,34 @@
+// Copyright 2014 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 f32 implements some linear algebra and GL helpers for float32s.
+//
+// WARNING
+//
+// The interface to this package is not stable. It will change considerably.
+// Only use functions that provide package documentation. Semantics are
+// non-obvious. Be prepared for the package name to change.
+//
+// Oh, and it's slow. Sorry.
+package f32
+
+import "math"
+
+type Radian float32
+
+func Cos(x float32) float32 {
+ return float32(math.Cos(float64(x)))
+}
+
+func Sin(x float32) float32 {
+ return float32(math.Sin(float64(x)))
+}
+
+func Sqrt(x float32) float32 {
+ return float32(math.Sqrt(float64(x))) // TODO(crawshaw): implement
+}
+
+func Tan(x float32) float32 {
+ return float32(math.Tan(float64(x))) // TODO(crawshaw): fast version
+}
« no previous file with comments | « no previous file | f32/f32_test.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b