package main import "fmt" type S string type I int64 type F float64 type C complex128 func (s S) String() string { return string(s) } func (i I) String() string { pre := "" if i < 0 { pre = "¯" i = -i } return fmt.Sprint(pre, int64(i)) } func (f F) String() string { pre := "" if f < 0 { pre = "¯" f = -f } return fmt.Sprint(pre, float64(f)) } func (c C) String() string { return fmt.Sprint(F(real(c)), "J", F(imag(c))) }