in reply to splitting a decimal number..
$ perl -MPOSIX -le ' my($f,$i)=POSIX::modf(3.14); print "f=$f; i=$i";' f=0.14; i=3 [download]
That might be more reliable than simple subtraction with negative numbers.