File tree 1 file changed +5
-7
lines changed
1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -601,9 +601,7 @@ func Zero(sign int) float64 {
601
601
// +1 if x > 0
602
602
// Sign panics if x is NaN.
603
603
func Sign (x float64 ) int {
604
- if math .IsNaN (x ) {
605
- panicForNaN (x )
606
- }
604
+ panicForNaN (x )
607
605
switch {
608
606
case x < 0 :
609
607
return - 1
@@ -614,9 +612,9 @@ func Sign(x float64) int {
614
612
}
615
613
616
614
// SignInt returns:
617
- // -1 if x < 0
618
- // 0 if x is 0
619
- // +1 if x > 0
615
+ // -1 if x < 0
616
+ // 0 if x is 0
617
+ // +1 if x > 0
620
618
func SignInt (x int64 ) int {
621
619
switch {
622
620
case x < 0 :
@@ -730,7 +728,7 @@ func AvgUint2(x ...uint64) (avg uint64, overflow bool) {
730
728
}
731
729
732
730
func panicForInvalidBase (base int ) {
733
- if base < MinBase || base > MaxBase {
731
+ if ! ( MinBase <= base && base <= MaxBase ) {
734
732
panic ("invalid base" )
735
733
}
736
734
}
You can’t perform that action at this time.
0 commit comments