1

I’m not entirely sure if this is possible, but I would like to make numbers composed of other numbers. For example, given $a$, $b$, and $c$, I’d like to make a number such that the digits are $a.bc$.

So, if $a = 1$, $b = 2$, and $c = 3$, we would have the number $1.23$. Is this possible?

Thanks!

  • Sure, use powers of $10$: $1.23=1\cdot 10^0+2\cdot 10^{-1}+3\cdot 10^{-2}$ – Vasili Mar 16 '18 at 14:16
  • This is not clear. You can write out any number you want. That said, I don't understand your construction. Are $a,b,c$ meant to be positive integers? What would you do with $a=101, b=202,c=303$? Would you write $101.202303$? That would make sense, but I can't imagine what you have in mind if $a,b,c$ are irrational or negative. – lulu Mar 16 '18 at 14:17
  • Welcome to MSE. Please read this text about how to ask a good question. – José Carlos Santos Mar 16 '18 at 14:17
  • @lulu: OP mentions that $a$, $b$ and $c$ are digits. But I agree with you that the way the digits are combined is not defined. – Vasili Mar 16 '18 at 14:20
  • @Vasya Where is it said that $a,b,c$ are digits? – lulu Mar 16 '18 at 14:21
  • @lulu $a$, $b$, and $c$ are positive integers – Joseph Eck Mar 16 '18 at 15:20
  • That should be added to the post. If you are looking for code that does what you want you will need to first write a function that gives you the number of digits in an integer, so $n(b)=\lfloor \log_{10}(b) \rfloor+1$ or such. – lulu Mar 16 '18 at 15:25

2 Answers2

1

I think what you want is:

 FromDigits[{a, b, c}] // Simplify

100 a + 10 b + c

For your example:

 FromDigits[{1, 2, 3}]/100.

1.23

wolfies
  • 5,174
0

Yes, as long as you know what you want to do and you do the mathematics correctly, go ahead and create new numbers out of the old ones.

That is a good way to understand numbers better.

They have created the set of positive integers starting at 1 and adding one each time.

$$1, 1+1=2, 2+1=3,....$$