Le 2011-12-16 à 00:52:00, Alexandre Torres Porres a écrit :
Is there an external that converts decimal numbers to fractions, like 1.5 => 3 / 2 ? I bet it's complicated to do it as a vanilla patch, right?
Take the number, subtract its whole part to get something less than 1, then invert it to get something bigger than 1, and repeat.
You will get a list of characteristic numbers that can be used to make good approximations real quick by doing a+1/(b+1/(c+1/(d+1/(e+etc...))))
But unlike what this latter formula looks like, you don't even need to keep a list containing values a b c d e etc... because there's a simple shortcut so that you don't have to start with the innermost parentheses.
http://pt.wikipedia.org/wiki/Fra%C3%A7%C3%A3o_cont%C3%ADnua
| Mathieu BOUCHARD ----- téléphone : +1.514.383.3801 ----- Montréal, QC