You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
6g doesn't accept this, gccgo does.
package main
const ten = 100 * 0.1
const fifty = 100 * 0.5
var x int = ten // this does not work
var y int = fifty // this works
// 6g test.go
// test.go:6: constant 10 truncated to integer
0.1 cannot be accurately represented in binary form, but this case seems like it should
work. Perhaps there is a rounding bug somewhere or the number of bits used internally
needs to be increased (short of using rationals).