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

Delta Between Two Patch Sets: src/pkg/cmath/isinf.go

Issue 874041: code review 874041: cmath pkg (Closed)
Left Patch Set: code review 874041: cmath pkg Created 15 years ago
Right Patch Set: code review 874041: cmath pkg Created 14 years, 12 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/cmath/exp.go ('k') | src/pkg/cmath/isnan.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2010 The Go Authors. All rights reserved. 1 // Copyright 2010 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package cmath 5 package cmath
6 6
7 import "math" 7 import "math"
8 8
9 // IsInf(x) returns true if either real(x) or imag(x) is an infinity. 9 // IsInf returns true if either real(x) or imag(x) is an infinity.
10 func IsInf(x complex128) bool { 10 func IsInf(x complex128) bool {
11 » // TODO(rsc) remove inlining whem compiler does it for us 11 » if math.IsInf(real(x), 0) || math.IsInf(imag(x), 0) {
rsc1 2010/04/02 07:13:53 Not worth it in this one: return math.IsInf(real(
12 » if real(x) < -math.MaxFloat64 || real(x) > math.MaxFloat64 || imag(x) < -math.MaxFloat64 || imag(x) > math.MaxFloat64 { // if math.IsInf(real(x), 0) || math.IsInf(imag(x), 0) {
13 return true 12 return true
14 } 13 }
15 return false 14 return false
16 } 15 }
17 16
18 // Inf() returns a complex infinity. 17 // Inf returns a complex infinity, cmplx(+Inf, +Inf).
rsc1 2010/04/02 07:13:53 // Inf returns a complex infinity, cmplx(+Inf, +In
19 func Inf() complex128 { 18 func Inf() complex128 {
20 inf := math.Inf(1) 19 inf := math.Inf(1)
21 return cmplx(inf, inf) 20 return cmplx(inf, inf)
22 } 21 }
LEFTRIGHT

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