Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for sum (0.14 sec)

  1. doc/go1.17_spec.html

    distinct arrays always represent distinct storage.
    </p>
    <p>
    The array underlying a slice may extend past the end of the slice.
    The <i>capacity</i> is a measure of that extent: it is the sum of
    the length of the slice and the length of the array beyond the slice;
    a slice of length up to that capacity can be created by
    <a href="#Slice_expressions"><i>slicing</i></a> a new one from the original slice.
    HTML
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Apr 11 20:22:45 GMT 2024
    - 211.6K bytes
    - Viewed (0)
  2. doc/go_spec.html

    </p>
    
    <pre>
    // sum returns the sum (concatenation, for strings) of its arguments.
    func sum[T ~int | ~float64 | ~string](x... T) T { … }
    
    x := sum                       // illegal: the type of x is unknown
    intSum := sum[int]             // intSum has type func(x... int) int
    a := intSum(2, 3)              // a has value 5 of type int
    b := sum[float64](2.0, 3)      // b has value 5.0 of type float64
    HTML
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Apr 26 00:39:16 GMT 2024
    - 279.6K bytes
    - Viewed (0)
Back to top