support negative values
code formatted
support negative values