3 // Copyright 2009 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
14 func assert(t bool, s string) {
24 assert(c3div2 == 1, "3/2");
25 assert(f3div2 == 1.5, "3/2");
28 assert(i == c3div2, "i == c3div2");
31 assert(f == c3div2, "f == c3div2");
34 assert(f == f3div2, "f == f3div2");
36 i = f3div2; // ERROR "truncate"
37 assert(i == c3div2, "i == c3div2 from f3div2");
38 assert(i != f3div2, "i != f3div2"); // ERROR "truncate"
40 const g float64 = 1.0;
41 i = g; // ERROR "convert|incompatible|cannot"
43 const h float64 = 3.14;
44 i = h; // ERROR "convert|incompatible|cannot"
45 i = int(h); // ERROR "truncate"