`a * pow(10, log10(b)) + b`
# announcements
d
a * pow(10, log10(b)) + b
h
Whats this man
b
h
But why you use log10 and stuf for rising number to an exponent
d
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.