| // Copyright 2012 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| func ExampleRat_SetString() { |
| fmt.Println(r.FloatString(3)) |
| func ExampleInt_SetString() { |
| i.SetString("644", 8) // octal |
| // The Scan function is rarely used directly; |
| // the fmt package recognizes it as an implementation of fmt.Scanner. |
| _, err := fmt.Sscan("1.5000", r) |
| log.Println("error scanning value:", err) |
| // The Scan function is rarely used directly; |
| // the fmt package recognizes it as an implementation of fmt.Scanner. |
| _, err := fmt.Sscan("18446744073709551617", i) |
| log.Println("error scanning value:", err) |
| // Output: 18446744073709551617 |