Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for equalNaN (0.07 sec)

  1. src/slices/slices_test.go

    		}
    	}
    }
    
    // equal is simply ==.
    func equal[T comparable](v1, v2 T) bool {
    	return v1 == v2
    }
    
    // equalNaN is like == except that all NaNs are equal.
    func equalNaN[T comparable](v1, v2 T) bool {
    	isNaN := func(f T) bool { return f != f }
    	return v1 == v2 || (isNaN(v1) && isNaN(v2))
    }
    
    // offByOne returns true if integers v1 and v2 differ by 1.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 13:32:06 UTC 2024
    - 33.2K bytes
    - Viewed (0)
Back to top