Wednesday, 3 September 2014

Imperializer Calculator

I've been playing around with AngularJS, flask and python in order to host a script that I wrote in python. Basically converting decimals into US fractions for measurements is a bit of a pain if you're doing it on paper and calculators don't convert to fractions unless you have the exact number. But if you have the exact number you'll likely remember the corresponding fraction anyway! So for everyday irregular numbers, feel free to use my calculator.

Shorter link for sharing: http://goo.gl/U7b2pO


Example 1: Convert 1.25 into a fraction
Too easy, 0.25 is easily remembered as one quarter or 1/4, so the answer is 1 1/4. No need for any special calculators.

Example 2: Convert 1.544 into a fraction
This one is more interesting, and does not give a round remainder with fractions that have a denominator that is a multiple of 2. If you can live with a remainder of 0.044 then you can say that this equals 1 1/2. If you've memorized the 1/16 series of fractions, you might pick 1.5625 and have a smaller remainder. For even more precision you'd have to use an algorithm to find the closer answer. Using the above linked calculator the answer is 1 35/64 with a remainder of 0.002875.



It should be stated that it is important to notify your rounding method to whoever is using any raw numbers coming off of computer output. For myself the example was precision steel fabrication, and decimals were preferred as they were input into a CNC machine. Using fractions would have introduced unnecessary errors. However for numbers that need to be measured by an operator, fractions were used for convenience.

No comments:

Post a Comment