How about moving the extra abs into the splitLong function so all the abs/uglyness is together? 

Also adding a comment beside it as to why we have two math.abs might be good too?