Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for ExampleInt_SetString (0.12 sec)

  1. src/math/big/example_test.go

    import (
    	"fmt"
    	"log"
    	"math"
    	"math/big"
    )
    
    func ExampleRat_SetString() {
    	r := new(big.Rat)
    	r.SetString("355/113")
    	fmt.Println(r.FloatString(3))
    	// Output: 3.142
    }
    
    func ExampleInt_SetString() {
    	i := new(big.Int)
    	i.SetString("644", 8) // octal
    	fmt.Println(i)
    	// Output: 420
    }
    
    func ExampleFloat_SetString() {
    	f := new(big.Float)
    	f.SetString("3.14159")
    	fmt.Println(f)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 26 16:15:32 UTC 2020
    - 4K bytes
    - Viewed (0)
Back to top