Implemented the LN function in ruby and C