numbers.go 446 B

123456789101112131415161718192021222324252627282930313233
  1. package serial
  2. import (
  3. "strconv"
  4. )
  5. type Uint16 interface {
  6. Value() uint16
  7. }
  8. type Uint16Literal uint16
  9. func (this Uint16Literal) String() string {
  10. return strconv.Itoa(int(this))
  11. }
  12. func (this Uint16Literal) Value() uint16 {
  13. return uint16(this)
  14. }
  15. type Int interface {
  16. Value() int
  17. }
  18. type IntLiteral int
  19. func (this IntLiteral) String() string {
  20. return strconv.Itoa(int(this))
  21. }
  22. func (this IntLiteral) Value() int {
  23. return int(this)
  24. }