subject

Although computers generally represent numbers as decimals, it is often convenient to express values as fractions. if we desire to convert a decimal to a fraction, we need to follow a two-step process: starting with the number itself, multiply by ten repeatedly until no values remain after the decimal point. this is the numerator. keep the multiplier as the denominator. simplify the fraction. for instance, for 0.75: multiply by ten repeatedly: 0.75×10×10=75 thus the numerator is 75 and the denominator is 10×10=100. simplify the fraction: find the factors of the numerator and the denominator. 75→{1,3,5,15,25,75}100→{1,2,4,5,10, 20,25,50,100} find the greatest common factor of each and divide both by it. 75÷25=3100÷25=4 0.75→34 write a function factors( n ) which accepts a number n and returns a list containing all of the factors of that number. (this is a common task. write your own code—don't just it! ) write a function fraction( n ) which accepts a decimal number n and returns a tuple ( numerator, denominator ) of the resulting fraction representation.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 04:00
Acetylene is a gas which burns rapidly on its own, and is considered highly explosive. a) true b) false
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
Facial expressions and gestures are examples of messages.
Answers: 3
question
Computers and Technology, 23.06.2019 18:00
Apunishment or the threat of punishment used to enforce conformity. select the best answer from the choices provided t f
Answers: 1
question
Computers and Technology, 23.06.2019 23:30
The keyboard usually has six rows of keys. which of the following is not one of the key group categories? letter keys number keys control keys graphic keys
Answers: 1
You know the right answer?
Although computers generally represent numbers as decimals, it is often convenient to express values...
Questions
question
Biology, 14.04.2020 23:35
question
Mathematics, 14.04.2020 23:35
Questions on the website: 13722361