diff --git a/kern/fraction-type.go b/kern/fraction-type.go index fab5e2e..e44adcb 100644 --- a/kern/fraction-type.go +++ b/kern/fraction-type.go @@ -44,10 +44,11 @@ func MakeGeneratingFraction(s string) (f *FractionType, err error) { if len(s) == 0 { goto exit } - if s[0] == '-' { + switch s[0] { + case '-': sign = int64(-1) s = s[1:] - } else if s[0] == '+' { + case '+': s = s[1:] } // if strings.HasSuffix(s, "()") {