From 58f866493fe786b1e583f7dddf8219ea4f0d5824 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Tue, 13 Mar 2018 00:36:31 +0100 Subject: add comment on interval --- roman.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roman.go b/roman.go index 7a7c4b3..f57e655 100644 --- a/roman.go +++ b/roman.go @@ -21,11 +21,11 @@ var ( m6 = []string{"", "M̅", "M̅M̅", "M̅M̅M̅"} ) -// Roman represents a roman numeral +// Roman represents a roman numeral in interval 0 < x < 4e6 type Roman int func (n Roman) String() string { - if n < 1 || n >= 4e6 { + if n <= 0 || n >= 4e6 { return "" } // this is efficient in Go. the seven operands are evaluated, -- cgit v1.2.3