-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathint.go
51 lines (41 loc) · 996 Bytes
/
int.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package isodd
// check int8 whether is odd
func Int8(i int8) bool {
return i%2 == oddCheckNum || i%2 == oddCheckNumNeg
}
// check int16 whether is odd
func Int16(i int16) bool {
return i%2 == oddCheckNum || i%2 == oddCheckNumNeg
}
// check int32 whether is odd
func Int32(i int32) bool {
return i%2 == oddCheckNum || i%2 == oddCheckNumNeg
}
// check int64 whether is odd
func Int64(i int64) bool {
return i%2 == oddCheckNum || i%2 == oddCheckNumNeg
}
// check int whether is odd
func Int(i int) bool {
return i%2 == oddCheckNum || i%2 == oddCheckNumNeg
}
// check uint8 whether is odd
func Uint8(i uint8) bool {
return i%2 == oddCheckNum
}
// check uint16 whether is odd
func Uint16(i uint16) bool {
return i%2 == oddCheckNum
}
// check uint32 whether is odd
func Uint32(i uint32) bool {
return i%2 == 1
}
// check uint64 whether is odd
func Uint64(i uint64) bool {
return i%2 == oddCheckNum
}
// check uint whether is odd
func Uint(i uint) bool {
return i%2 == oddCheckNum
}