blob: 40e8084b2b374ef8406957c26631d3b6ac46b866 [file] [log] [blame]
Oleksandr Redko97c56ed2024-06-25 17:41:30 +03001//go:build OMIT
Andrew Gerrand8775c8e2014-02-24 14:28:32 +11002
Andrew Gerrand009a79d2013-01-23 17:39:23 +11003package main
4
5import "fmt"
6
7const (
Katrina Owen1ae3b952016-02-09 08:32:19 +11008 // Create a huge number by shifting a 1 bit left 100 places.
9 // In other words, the binary number that is 1 followed by 100 zeroes.
10 Big = 1 << 100
11 // Shift it right again 99 places, so we end up with 1<<1, or 2.
12 Small = Big >> 99
Andrew Gerrand009a79d2013-01-23 17:39:23 +110013)
14
15func needInt(x int) int { return x*10 + 1 }
16func needFloat(x float64) float64 {
17 return x * 0.1
18}
19
20func main() {
21 fmt.Println(needInt(Small))
22 fmt.Println(needFloat(Small))
23 fmt.Println(needFloat(Big))
24}