Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for ceilFrac (0.15 sec)

  1. cmd/utils_test.go

    		etag := ToS3ETag(testCase.etag)
    		if etag != testCase.expectedETag {
    			t.Fatalf("test %v: expected: %v, got: %v", i+1, testCase.expectedETag, etag)
    		}
    	}
    }
    
    // Test ceilFrac
    func TestCeilFrac(t *testing.T) {
    	cases := []struct {
    		numerator, denominator, ceiling int64
    	}{
    		{0, 1, 0},
    		{-1, 2, 0},
    		{1, 2, 1},
    		{1, 1, 1},
    		{3, 2, 2},
    		{54, 11, 5},
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Feb 23 21:28:14 GMT 2024
    - 10.2K bytes
    - Viewed (0)
  2. cmd/erasure-metadata.go

    	}
    	numShards := totalLength / e.BlockSize
    	lastBlockSize := totalLength % e.BlockSize
    	lastShardSize := ceilFrac(lastBlockSize, int64(e.DataBlocks))
    	return numShards*e.ShardSize() + lastShardSize
    }
    
    // ShardSize - returns actual shared size from erasure blockSize.
    func (e ErasureInfo) ShardSize() int64 {
    	return ceilFrac(e.BlockSize, int64(e.DataBlocks))
    }
    
    // IsValid - tells if erasure info fields are valid.
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sun Apr 28 17:53:50 GMT 2024
    - 19.2K bytes
    - Viewed (1)
  3. cmd/utils.go

    		TCPOptions:       globalTCPOptions,
    		EnableHTTP2:      false,
    	}.NewRemoteTargetHTTPTransport(insecure)
    }
    
    // ceilFrac takes a numerator and denominator representing a fraction
    // and returns its ceiling. If denominator is 0, it returns 0 instead
    // of crashing.
    func ceilFrac(numerator, denominator int64) (ceil int64) {
    	if denominator == 0 {
    		// do nothing on invalid input
    		return
    	}
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Wed May 01 15:18:21 GMT 2024
    - 31.4K bytes
    - Viewed (0)
Back to top