0

So here is what things will convert to: 0.5 = 2; 0.25 = 4; + MILLIONS MORE

1 = The whole of a number ( / 1 )

0.5 = Half of the number ( / 2)

But what is the math to convert decimals into only a hardcore integer?

  • 1
    You are always allowed to multiply by one or add zero in any context. The trick is what "one" looks like. In these cases, it is common to multiply by a fraction of something over itself. $0.25 = 0.25\cdot 1 = 0.25\cdot\frac{4}{4} = \frac{0.25\cdot 4}{4} = \frac{1}{4}$ – JMoravitz Dec 12 '14 at 21:17
  • Right. But how can we convert this. What number do you need to divide a number by to get this decimal of it. So. 0.50 of 200 is 100. Because we divided it by 2. Now what is the math needed to turn 0.50 into 2. Good Example: 0.50 * 100 / etc etc... –  Dec 12 '14 at 21:20
  • Sorry if its unclear. Its that I need this for a programming algorithm for work. –  Dec 12 '14 at 21:22
  • If you have a decimal which is, say, 8 decimals in length, for example $0.12345678$, you can multiply by $\frac{100000000}{100000000}$. It will possibly be overkill and can simplify further, but will always work to get it in the form $\frac{\text{whole number}}{\text{whole number}}$ – JMoravitz Dec 12 '14 at 21:24
  • Well I give up. Ill talk to my fellow programmers. Thanks for trig. It was my side for not making a clear question. –  Dec 12 '14 at 21:26
  • I think you may also be thinking of the relation between $0.5$ and $2$., note that $\frac{1}{0.5}=2$ and $\frac{1}{0.25} = 4$ – JMoravitz Dec 12 '14 at 21:28
  • 1
    @JMoravitz I found out thanks for help anyway! –  Dec 12 '14 at 21:35

3 Answers3

1

I think what you are looking for is the reciprocal or multiplicative inverse of the number, typically denoted $x^{-1}$ or $\frac{1}{x}$. Using your example of $0.5$, you have $0.5=\frac{1}{2}$. How do you get $2$ from this? Well, $(0.5)^{-1}=\left(\frac{1}{2}\right)^{-1}=\dfrac{1}{\frac{1}{2}}=2$. This will only produce an integer if the decimal you are using is the inverse of an integer.

KSmarts
  • 3,364
0

I believe what you are looking for is the reciprocal.

$0.5 = \frac12$ and also in general $0.5 = \frac{x}{2x}$ for every real number $x$ aside from $0$.

The reciprocal is like "flipping the fraction". Indeed, the reciprocal of $\frac12$ is $\frac{2}{1}$. Likewise, the reciprocal of $\frac{x}{2x}$ is $\frac{2x}{x}$. In this latter example, $x\neq 0$, so the $x$ in the numerator and the denominator cancel: $\frac{2x}{x} = 2$.

A repeating or terminating decimal representation can always be turned into a fraction (because a terminating or repeating decimal number is rational). To see a general technique for doing so, see for example here. In that example, the number $0.234343434\ldots$ has a reciprocal of $\frac{495}{116}$.

One interesting property of reciprocals is that any (nonzero) number multiplied by its reciprocal will result in 1!. This is because in general $$\frac{a}{b} \cdot \frac{b}{a} = \frac{ab}{ab} = 1.$$

Emily
  • 35,688
  • 6
  • 93
  • 141
0

I found out my programmers helped! So 0.25 keep adding it:

  • 0.25 - 0.50 -----0.75----1.00

  • 1 ------- 2 ------- 3 ------ 4

So you had to times 0.25 > 4 times < before it made 1. So the answer is 4.

For example here it is for 0.5:

  • 0.5 - 1

  • 1 ---- 2

Had to times it twice so its 2.

That is how you do it! By keep timesing it intil it creates 1 and count how many times it took and divide the final number by that:

0.25 of 1000:

  • 0.25 - 0.50 -----0.75----1.00

  • 1 ------- 2 ------- 3 ------ 4

1000 / 4.

That is the algorithm. I feel stupid now.