Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for ExampleRat_SetString (0.33 sec)

  1. src/math/big/example_test.go

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