Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 216 for arithmetic (0.24 sec)

  1. test/fixedbugs/issue6866.go

    // WARNING: GENERATED FILE - DO NOT MODIFY MANUALLY!
    // (To generate, in go/types directory: go test -run=Hilbert -H=2 -out="h2.src")
    
    // This program tests arbitrary precision constant arithmetic
    // by generating the constant elements of a Hilbert matrix H,
    // its inverse I, and the product P = H*I. The product should
    // be the identity matrix.
    package main
    
    func main() {
    	if !ok {
    		print()
    		return
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 02 22:49:47 UTC 2015
    - 1.5K bytes
    - Viewed (0)
  2. test/fixedbugs/issue14651.go

    // Copyright 2016 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.
    
    // This test checks if the compiler's internal constant
    // arithmetic correctly rounds up floating-point values
    // that become the smallest denormal value.
    //
    // See also related issue 14553 and test issue14553.go.
    
    package main
    
    import (
    	"fmt"
    	"math"
    )
    
    const (
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 22 17:09:29 UTC 2016
    - 1.9K bytes
    - Viewed (0)
  3. src/math/sincos.go

    		if j&1 == 1 { // map zeros to origin
    			j++
    			y++
    		}
    		j &= 7                               // octant modulo 2Pi radians (360 degrees)
    		z = ((x - y*PI4A) - y*PI4B) - y*PI4C // Extended precision modular arithmetic
    	}
    	if j > 3 { // reflect in x axis
    		j -= 4
    		sinSign, cosSign = !sinSign, !cosSign
    	}
    	if j > 1 {
    		cosSign = !cosSign
    	}
    
    	zz := z * z
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 11 16:34:30 UTC 2022
    - 1.8K bytes
    - Viewed (0)
  4. src/math/cmplx/tan.go

    // of PI/2. The denominator is evaluated by its Taylor
    // series near these points.
    //
    // ctan(z) = -i ctanh(iz).
    //
    // ACCURACY:
    //
    //                      Relative error:
    // arithmetic   domain     # trials      peak         rms
    //    DEC       -10,+10      5200       7.1e-17     1.6e-17
    //    IEEE      -10,+10     30000       7.2e-16     1.2e-16
    // Also tested by ctan * ccot = 1 and catan(ctan(z))  =  z.
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 01 03:16:37 UTC 2020
    - 8.5K bytes
    - Viewed (0)
  5. src/strconv/ftoaryu.go

    	d.dp -= q
    }
    
    // mulByLog2Log10 returns math.Floor(x * log(2)/log(10)) for an integer x in
    // the range -1600 <= x && x <= +1600.
    //
    // The range restriction lets us work in faster integer arithmetic instead of
    // slower floating point arithmetic. Correctness is verified by unit tests.
    func mulByLog2Log10(x int) int {
    	// log(2)/log(10) ≈ 0.30102999566 ≈ 78913 / 2^18
    	return (x * 78913) >> 18
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 09 00:28:56 UTC 2022
    - 15.7K bytes
    - Viewed (0)
  6. test/ken/cplx1.go

    // run
    
    // Copyright 2010 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.
    
    // Test simple arithmetic and assignment for complex numbers.
    
    package main
    
    const (
    	R = 5
    	I = 6i
    
    	C1 = R + I // ADD(5,6)
    )
    
    func main() {
    	var b bool
    
    	// constants
    	b = (5 + 6i) == C1
    	if !b {
    		println("const bool 1", b)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 24 05:24:24 UTC 2012
    - 1.4K bytes
    - Viewed (0)
  7. guava/src/com/google/common/hash/Fingerprint2011.java

     * fingerprint at 4.0 microseconds and md5 at 4.5 microseconds.
     *
     * <p>Note to maintainers: This implementation relies on signed arithmetic being bit-wise equivalent
     * to unsigned arithmetic in all cases except:
     *
     * <ul>
     *   <li>comparisons (signed values can be negative)
     *   <li>division (avoided here)
     *   <li>shifting (right shift must be unsigned)
     * </ul>
     *
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Tue Dec 28 17:50:25 UTC 2021
    - 6.5K bytes
    - Viewed (0)
  8. guava/src/com/google/common/math/LongMath.java

        return (int) x == x;
      }
    
      /**
       * Returns the arithmetic mean of {@code x} and {@code y}, rounded toward negative infinity. This
       * method is resilient to overflow.
       *
       * @since 14.0
       */
      public static long mean(long x, long y) {
        // Efficient method for computing the arithmetic mean.
        // The alternative (x + y) / 2 fails for large values.
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Feb 07 17:50:39 UTC 2024
    - 44.6K bytes
    - Viewed (0)
  9. src/math/remainder.go

    // is preserved.
    // ====================================================
    //
    // __ieee754_remainder(x,y)
    // Return :
    //      returns  x REM y  =  x - [x/y]*y  as if in infinite
    //      precision arithmetic, where [x/y] is the (infinite bit)
    //      integer nearest x/y (in half way cases, choose the even one).
    // Method :
    //      Based on Mod() returning  x - [x/y]chopped * y  exactly.
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 11 16:34:30 UTC 2022
    - 2K bytes
    - Viewed (0)
  10. src/image/png/paeth.go

    	// This is an optimized version of the sample code in the PNG spec.
    	// For example, the sample code starts with:
    	//	p := int(a) + int(b) - int(c)
    	//	pa := abs(p - int(a))
    	// but the optimized form uses fewer arithmetic operations:
    	//	pa := int(b) - int(c)
    	//	pa = abs(pa)
    	pc := int(c)
    	pa := int(b) - pc
    	pb := int(a) - pc
    	pc = abs(pa + pb)
    	pa = abs(pa)
    	pb = abs(pb)
    	if pa <= pb && pa <= pc {
    		return a
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 08 04:08:51 UTC 2014
    - 1.7K bytes
    - Viewed (0)
Back to top