From f3d13f45bc1f948e9384c473ee0ec0a3c7507972 Mon Sep 17 00:00:00 2001 From: Dan Kortschak Date: Thu, 6 Aug 2020 20:48:08 +0930 Subject: [PATCH] cmplxs/cscalar,floats/scalar: expand return value names --- cmplxs/cscalar/cscalar.go | 12 ++++++------ floats/scalar/scalar.go | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cmplxs/cscalar/cscalar.go b/cmplxs/cscalar/cscalar.go index a36bee7c..3c9e1bfe 100644 --- a/cmplxs/cscalar/cscalar.go +++ b/cmplxs/cscalar/cscalar.go @@ -45,17 +45,17 @@ func EqualWithinAbsOrRel(a, b complex128, absTol, relTol float64) bool { return EqualWithinAbs(a, b, absTol) || EqualWithinRel(a, b, relTol) } -// ParseWithNA converts the string s to a complex128 in v. -// If s equals missing, w is returned as 0, otherwise 1. -func ParseWithNA(s, missing string) (v complex128, w float64, err error) { +// ParseWithNA converts the string s to a complex128 in value. +// If s equals missing, weight is returned as 0, otherwise 1. +func ParseWithNA(s, missing string) (value complex128, weight float64, err error) { if s == missing { return 0, 0, nil } - v, err = parse(s) + value, err = parse(s) if err == nil { - w = 1 + weight = 1 } - return v, w, err + return value, weight, err } // Round returns the half away from zero rounded value of x with prec precision. diff --git a/floats/scalar/scalar.go b/floats/scalar/scalar.go index fc30e05c..5d85e6b0 100644 --- a/floats/scalar/scalar.go +++ b/floats/scalar/scalar.go @@ -89,17 +89,17 @@ func NaNPayload(f float64) (payload uint64, ok bool) { return b &^ nanMask, true } -// ParseWithNA converts the string s to a float64 in v. -// If s equals missing, w is returned as 0, otherwise 1. -func ParseWithNA(s, missing string) (v, w float64, err error) { +// ParseWithNA converts the string s to a float64 in value. +// If s equals missing, weight is returned as 0, otherwise 1. +func ParseWithNA(s, missing string) (value, weight float64, err error) { if s == missing { return 0, 0, nil } - v, err = strconv.ParseFloat(s, 64) + value, err = strconv.ParseFloat(s, 64) if err == nil { - w = 1 + weight = 1 } - return v, w, err + return value, weight, err } // Round returns the half away from zero rounded value of x with prec precision.