Hello, i'm absolute beginner

Could you help me ?


package main

import "fmt"

const (
// Create a huge number by shifting a 1 bit left 100 places.
// In other words, the binary number that is 1 followed by 100 zeroes.
Big = 1 << 100
// Shift it right again 99 places, so we end up with 1<<1, or 2.
Small = Big >> 99
)

func needInt(x int) int { return x*10 + 1 }
func needFloat(x float64) float64 {
return x * 0.1
}

func main() {
//fmt.Println(needInt(Small))
//fmt.Println(needFloat(Small))

//fmt.Println(needFloat(Big))
fmt.Printf("%T", Big)                                                      
             // What is the problem with this ???? from golang tour 16. page

}


tmp/sandbox854410474/main.go:23:13: constant 1267650600228229401496703205376 
overflows int


thanks Attila Kovács



-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to