Convert decimal to fraction (rational number) in Objective C?
问题 As part of a calculator app, I am trying to implement uses with sigma notation. However, the result it prints out is always a decimal, and the rest isn't important. I simply want to change the decimal to a fraction. I already have the reduce function, the problem I'm having is getting from a decimal like this: '0.96875' to it's fractional value, '31/32' Thanks! PS: I've looked into just about everything, and for the life of me, I can't figure this out. All I need at this point is how to take