Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for ExampleAbs (0.28 sec)

  1. src/math/cmplx/example_test.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    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)
    }
    
    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

    func ExampleRemainder() {
    	fmt.Printf("%.1f", math.Remainder(100, 30))
    	// Output: 10.0
    }
    
    func ExampleMod() {
    	c := math.Mod(7, 4)
    	fmt.Printf("%.1f", c)
    	// Output: 3.0
    }
    
    func ExampleAbs() {
    	x := math.Abs(-2)
    	fmt.Printf("%.1f\n", x)
    
    	y := math.Abs(2)
    	fmt.Printf("%.1f\n", y)
    	// Output:
    	// 2.0
    	// 2.0
    }
    func ExampleDim() {
    	fmt.Printf("%.2f\n", math.Dim(4, -2))
    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