Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for absDiff (0.11 sec)

  1. test/typeparam/absdiff.go

    Matthew Dempsky <******@****.***> 1646087539 -0800
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 2.9K bytes
    - Viewed (0)
  2. test/typeparam/absdiff3.go

    // run
    
    // Copyright 2022 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    // absdiff example using a function argument rather than attaching an
    // Abs method to a structure containing base types.
    
    package main
    
    import (
    	"fmt"
    	"math"
    )
    
    type Numeric interface {
    	OrderedNumeric | Complex
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 2.6K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/types2/check_test.go

    	switch err := err.(type) {
    	case syntax.Error:
    		return err.Pos, err.Msg
    	case Error:
    		return err.Pos, err.Msg
    	default:
    		return nopos, err.Error()
    	}
    }
    
    // absDiff returns the absolute difference between x and y.
    func absDiff(x, y uint) uint {
    	if x < y {
    		return y - x
    	}
    	return x - y
    }
    
    // parseFlags parses flags from the first line of the given source if the line
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 19:45:33 UTC 2024
    - 13.8K bytes
    - Viewed (0)
  4. test/typeparam/absdiff2.go

    // run
    
    // Copyright 2022 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    // absdiff example in which an Abs method is attached to a generic type, which is a
    // structure with a single field that may be a list of possible basic types.
    
    package main
    
    import (
    	"fmt"
    	"math"
    )
    
    type Numeric interface {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 09 21:26:42 UTC 2022
    - 3.6K bytes
    - Viewed (0)
  5. src/go/types/check_test.go

    	switch err := err.(type) {
    	case *scanner.Error:
    		return err.Pos, err.Msg
    	case Error:
    		return fset.Position(err.Pos), err.Msg
    	}
    	panic("unreachable")
    }
    
    // absDiff returns the absolute difference between x and y.
    func absDiff(x, y int) int {
    	if x < y {
    		return y - x
    	}
    	return x - y
    }
    
    // parseFlags parses flags from the first line of the given source if the line
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 19:45:33 UTC 2024
    - 14.1K bytes
    - Viewed (0)
  6. src/math/rand/v2/rand_test.go

    	stddev      float64
    	closeEnough float64
    	maxError    float64
    }
    
    func nearEqual(a, b, closeEnough, maxError float64) bool {
    	absDiff := math.Abs(a - b)
    	if absDiff < closeEnough { // Necessary when one value is zero and one value is close to zero.
    		return true
    	}
    	return absDiff/max(math.Abs(a), math.Abs(b)) < maxError
    }
    
    var testSeeds = []uint64{1, 1754801282, 1698661970, 1550503961}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 17.4K bytes
    - Viewed (0)
  7. src/math/rand/rand_test.go

    	stddev      float64
    	closeEnough float64
    	maxError    float64
    }
    
    func nearEqual(a, b, closeEnough, maxError float64) bool {
    	absDiff := math.Abs(a - b)
    	if absDiff < closeEnough { // Necessary when one value is zero and one value is close to zero.
    		return true
    	}
    	return absDiff/max(math.Abs(a), math.Abs(b)) < maxError
    }
    
    var testSeeds = []int64{1, 1754801282, 1698661970, 1550503961}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 16.9K bytes
    - Viewed (0)
  8. src/main/java/jcifs/smb/SmbCopyUtil.java

                            long ioff = 0;
                            for ( int i = 0; i < chunks; i++ ) {
                                long absoff = ooff + ioff;
                                int csize = i == chunks - 1 ? lastChunkSize : maxChunkSize;
                                chunkInfo[ i ] = new SrvCopychunk(absoff, absoff, csize);
                                ioff += maxChunkSize;
                            }
    
    Registered: Wed Jun 12 15:45:55 UTC 2024
    - Last Modified: Tue Jul 07 10:52:42 UTC 2020
    - 17.1K bytes
    - Viewed (0)
Back to top