Adds a length function

Adds a function that computes the length of the rational number