1// errorcheck
2
3// Copyright 2015 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.
6
7// Expects to see error messages on 'p' exponents
8// for non-hexadecimal floats.
9
10package main
11
12import "fmt"
13
14const (
15	x1 = 1.1    // float
16	x2 = 1e10   // float
17	x3 = 0x1e10 // integer (e is a hex digit)
18)
19
20const x4 = 0x1p10 // valid hexadecimal float
21const x5 = 1p10   // ERROR "'p' exponent requires hexadecimal mantissa|invalid prefix"
22const x6 = 0P0    // ERROR "'P' exponent requires hexadecimal mantissa|invalid prefix"
23
24func main() {
25	fmt.Printf("%g %T\n", x1, x1)
26	fmt.Printf("%g %T\n", x2, x2)
27	fmt.Printf("%g %T\n", x3, x3)
28	fmt.Printf("%g %T\n", x4, x4)
29	fmt.Printf("%g %T\n", x5, x5)
30	fmt.Printf("%g %T\n", x6, x6)
31}
32