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

Unified Diff: src/pkg/math/abs.go

Issue 5158043: code review 5158043: math: remove the leading F from Fabs etc. (Closed)
Patch Set: diff -r bc60e3827d04 https://go.googlecode.com/hg/ Created 13 years, 5 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 | « src/pkg/math/Makefile ('k') | src/pkg/math/abs_386.s » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pkg/math/abs.go
===================================================================
rename from src/pkg/math/fabs.go
rename to src/pkg/math/abs.go
--- a/src/pkg/math/fabs.go
+++ b/src/pkg/math/abs.go
@@ -4,18 +4,18 @@
package math
-// Fabs returns the absolute value of x.
+// Abs returns the absolute value of x.
//
// Special cases are:
-// Fabs(+Inf) = +Inf
-// Fabs(-Inf) = +Inf
-// Fabs(NaN) = NaN
-func Fabs(x float64) float64 {
+// Abs(+Inf) = +Inf
+// Abs(-Inf) = +Inf
+// Abs(NaN) = NaN
+func Abs(x float64) float64 {
switch {
case x < 0:
return -x
case x == 0:
- return 0 // return correctly fabs(-0)
+ return 0 // return correctly abs(-0)
}
return x
}
« no previous file with comments | « src/pkg/math/Makefile ('k') | src/pkg/math/abs_386.s » ('j') | no next file with comments »

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