Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for ExampleExp (0.13 sec)

  1. src/math/cmplx/example_test.go

    package cmplx_test
    
    import (
    	"fmt"
    	"math"
    	"math/cmplx"
    )
    
    func ExampleAbs() {
    	fmt.Printf("%.1f", cmplx.Abs(3+4i))
    	// Output: 5.0
    }
    
    // ExampleExp computes Euler's identity.
    func ExampleExp() {
    	fmt.Printf("%.1f", cmplx.Exp(1i*math.Pi)+1)
    	// Output: (0.0+0.0i)
    }
    
    func ExamplePolar() {
    	r, theta := cmplx.Polar(2i)
    	fmt.Printf("r: %.1f, θ: %.1f*π", r, theta/math.Pi)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 06 19:49:12 UTC 2016
    - 567 bytes
    - Viewed (0)
  2. src/math/example_test.go

    	// Output:
    	// 2.0
    	// 2.0
    }
    func ExampleDim() {
    	fmt.Printf("%.2f\n", math.Dim(4, -2))
    	fmt.Printf("%.2f\n", math.Dim(-4, 2))
    	// Output:
    	// 6.00
    	// 0.00
    }
    
    func ExampleExp() {
    	fmt.Printf("%.2f\n", math.Exp(1))
    	fmt.Printf("%.2f\n", math.Exp(2))
    	fmt.Printf("%.2f\n", math.Exp(-1))
    	// Output:
    	// 2.72
    	// 7.39
    	// 0.37
    }
    
    func ExampleExp2() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 07 18:09:53 UTC 2021
    - 3.7K bytes
    - Viewed (0)
Back to top