Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for SetPrec (0.09 sec)

  1. src/math/big/floatexample_test.go

    	// Operate on numbers of different precision.
    	var x, y, z big.Float
    	x.SetInt64(1000)          // x is automatically set to 64bit precision
    	y.SetFloat64(2.718281828) // y is automatically set to 53bit precision
    	z.SetPrec(32)
    	z.Add(&x, &y)
    	fmt.Printf("x = %.10g (%s, prec = %d, acc = %s)\n", &x, x.Text('p', 0), x.Prec(), x.Acc())
    	fmt.Printf("y = %.10g (%s, prec = %d, acc = %s)\n", &y, y.Text('p', 0), y.Prec(), y.Acc())
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 06 15:46:54 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  2. src/math/big/float.go

    //go:generate stringer -type=Accuracy
    
    // SetPrec sets z's precision to prec and returns the (possibly) rounded
    // value of z. Rounding occurs according to z's rounding mode if the mantissa
    // cannot be represented in prec bits without loss of precision.
    // SetPrec(0) maps all finite values to ±0; infinite values remain unchanged.
    // If prec > [MaxPrec], it is set to [MaxPrec].
    func (z *Float) SetPrec(prec uint) *Float {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 06 15:46:54 UTC 2024
    - 44.5K bytes
    - Viewed (0)
Back to top