Added a length function

I added a function that computes the length of the rational number