mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
math: rename Modf parameter int to integer
Avoid using int as a parameter name. Also, rename frac to fractional for consistency. Addresses comment on CL 694896: https://go-review.googlesource.com/c/go/+/694896/comment/a9723a07_8352e3aa/ Change-Id: Icedeecf65ad2f51d4e8d5bcf6e64c0eae9885dec Reviewed-on: https://go-review.googlesource.com/c/go/+/699035 Auto-Submit: Sean Liao <sean@liao.dev> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Sean Liao <sean@liao.dev> Reviewed-by: Joel Sing <joel@sing.id.au>
This commit is contained in:
parent
2a7f1d47b0
commit
3e596d448f
1 changed files with 3 additions and 3 deletions
|
|
@ -11,8 +11,8 @@ package math
|
|||
//
|
||||
// Modf(±Inf) = ±Inf, NaN
|
||||
// Modf(NaN) = NaN, NaN
|
||||
func Modf(f float64) (int float64, frac float64) {
|
||||
int = Trunc(f)
|
||||
frac = Copysign(f-int, f)
|
||||
func Modf(f float64) (integer float64, fractional float64) {
|
||||
integer = Trunc(f)
|
||||
fractional = Copysign(f-integer, f)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue