https://kotlinlang.org logo
Title
d

diesieben07

11/29/2018, 11:14 PM
a * pow(10, log10(b)) + b
h

Hamza

11/30/2018, 3:23 AM
Whats this man
b

bdawg.io

11/30/2018, 3:37 AM
h

Hamza

12/01/2018, 3:38 PM
But why you use log10 and stuf for rising number to an exponent
d

diesieben07

12/03/2018, 11:01 AM
Assuming integers:
log10(5) = 0
,
log10(140) = 2
, so basically "how many powers of 10 are in there". So for 5 and 15 you have to multiply 5 by however many lots of 10 are in 15 (1) and then add 15. However I notice now that I am missing a +1 in there, so it should be
a * pow(10, log10(b) + 1) + b
For 5 and 15 this becomes:
5 * pow(10, log10(15) + 1) + 15
which is
5 * pow(10, 1 + 1) + 15
which is
5 * 100 + 15
which is
515
=> the concatenated number.