[Question]
  [
## Task
Given two positive integers, output the number of carries needed to add them together in long addition in base 10.
## Examples
```
¬π¬π¬π   <-- carries
 999
+  1
----
1000
```
Three carries are needed.
```
 ¬π
 348
+ 91
----
 439
```
One carry is needed.
## Testcases
```
999,   1 -> 3
398,  91 -> 1
348,  51 -> 0
348,  52 -> 2
  5,  15 -> 1
999, 999 -> 3
505, 505 -> 2
```
## Scoring
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"). Shortest answer in bytes wins. [Standard loopholes](https://codegolf.meta.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default) apply.
  
[Answer]
# Mathematica, ~~46~~ 39 bytes
```
x=Tr@*IntegerDigits;(x@#+x@#2-x@+##)/9&
```
**input**
> 
> [348,51]
> 
> 
> 
*-7 bytes from JungHwan*
[Answer]
# JavaScript (ES6), 50 bytes
~~Fixed~~ Stolen from [ovs' solution](https://codegolf.stackexchange.com/a/125829/39244)
```
f=(a,b,c=0)=>a|b|c&&c+f(a/10,b/10,a%10+b%10+c>=10)
```
### Explanation
```
f=(a,b,c=0)=>                                      Function taking two numbers and optional carry
             a|b|c                                 If a number or the carry are nonzero
                  &&                               Then
                    c+f(a/10,b/10,a%10+b%10+c>=10) Return carry plus all other carries
```
### Carry explanation
```
a%10+b%10+c     Sum of mod 10 of the numbers and c - remember these are not floordiv'ed
           >=10 Greater than or equals to 10 (we can't use greater than 9 here)
```
```
f=(a,b,c=0)=>a|b|c&&c+f(a/10,b/10,a%10+b%10+c>=10)
console.log([[999,1],[398,91],[348,51],[348,52],[5,15],[999,999],[256,64],[190192,90909]].map(test=>`${(test[0]+'').padStart(6,' ')}, ${(test[1]+'').padStart(6,' ')} -> ${f(...test)}`).join('\n'));
```
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 65 bytes
```
i,l;f(a,b){for(i=l=0;a+b;a/=10,b/=10)i+=a%10+b%10+l>9?l=1:0;a=i;}
```
[Try it online!](https://tio.run/##VYxRCsIwEESvIoVClqyYqIWuYfUsSSSyEFsp/hXPHhMURJgZ3sdj4vYWYymC2SXlMcCa5kUJZzbO6@D8jq3B0BZEs@@t0aFNPtMlsz1VjcW9yt3LpGB9LDI9k@r66@Y/HSZFRGihwoFGpA8dRxx@tG80oB3gq9cC1Ps3 "C (gcc) ‚Äì Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~13 12 11~~ 9 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
-1 byte by porting [Jenny\_mathy's Mathematic answer](https://codegolf.stackexchange.com/a/125834/53748).  
-2 more bytes by better golfing :p
```
;SN$DFS:9
```
**[See the test suite](https://tio.run/##y0rNyan8/9862E/FxS3YyvL/0T2H2x81rfn/Pzra0tJSxzBWJ9rY0kLHEswwsdAxhTOMgAxTHUNTIAVSCcQgAQNTHSAGsgwtDQwtjXQsDYAwNhYA)**.
### How?
```
;SN$DFS:9 - Main link: list of numbers, [a,b]     e.g.   [348,53]
   $      - last two links as a monad
 S        -   sum                                            401
  N       -   negate                                        -401
;         - concatenate                             [348,53,-401] 
    D     - convert to decimal lists     [[3,4,8],[5,3],[-4,0,-1]]
     F    - flatten                           [3,4,8,5,3,-4,0,-1]
      S   - sum                                               18
       :9 - integer divide by nine                             2
```
---
My 12 byte solution...
```
:‚Åµ+
DUS√ß\>9S
```
A monadic link taking a pair of integers and returning the number of carries as an integer.
~~*There is probably a shorter way though!*~~ There was!
**[Try it online!](https://tio.run/##y0rNyan8/9/qUeNWbS6X0ODDy2PsLIP///8fbWhpYGhppGNpAISxAA "Jelly ‚Äì Try It Online")** or see the [test suite](https://tio.run/##y0rNyan8/9/qUeNWbS6X0ODDy2PsLIP/H91zuP1R05r//6OjLS0tdQxjdaKNLS10LMEMEwsdUzjDCMgw1TE0BVIglUAMEjAw1QFiIMvQ0sDQ0kjH0gAIY2MB).
### How
```
:‚Åµ+ ¬∑ Link 1: perform a carry: right-column's-digit-sum, a; left-colum's-digit-sum; b
 ‚Åµ  ¬∑ literal 10
:   ¬∑ a integer-divided by 10 - the carry amount
  + ¬∑ add to b
DUS√ß\>9S ¬∑ Main link: list of summands        e.g. [348,52]
D        ¬∑ convert to decimal lists                [[3,4,8],[5,2]]
 U       ¬∑ upend (reverse each)                    [[8,4,3],[2,5]]
  S      ¬∑ sum (add the digits up)                 [10,9,3]
    \    ¬∑ cumulative reduce with:
   √ß     ¬∑   last link (1) as a dyad               [10,10,4]
      9  ¬∑ literal 9
     >   ¬∑ greater than?                           [ 1, 1,0]
       S ¬∑ sum                                     2
```
[Answer]
# [Python](https://docs.python.org/2/), 48 bytes
```
f=lambda a,b,m=1:m<1e99and(~a%m<b%m)+f(a,b,m*10)
```
[Try it online!](https://tio.run/##Tc3BCoMwDADQ@74iFzFx3bBuwiK6Hxk7VLRMWKu4Xoa4X@9ad1kC4YUkZHq7x2gL73XzVKbtFCjRCtPIytSyZ1a2w49KTN0mhvYat2kmc/J6nMH1LweDhRsyswBJAvDEFwH84zmw/GMRWYbFMmK7CSVaci65CG0eku7VDkJM82AdpssKhyssa3oMP41yGN8K0JhFEJH/Ag "Python 2 ‚Äì Try It Online")
For each place value `m=1, 10, 100, ..., 10**99`, checks if there is a carry at that place value. The overflow check `a%m+b%m>=m` is shortened to `~a%m<b%m`.
A nicer [45-byte variant](https://tio.run/##Tc3BCsIwDAbgu0@Ry1hrq66bAzPYXkQ8pMziwHVj9iJjz15TvZhA@AIJ//wOj8lXMbr2SaPtCUjbhpQF8r2gzCibma41UjlBJ1Noy0NGNy0Q7q8Ag4erQEQNRmoQFV404I9nZv3HMrHmwzrh@8Mj2WBhsOS14Ja3Zgdc8zL4IPJ1g0MH65YfOXOkIFKsBif2CVLK@AE) where floats `a` and `b` shifted down instead
```
f=lambda a,b:a+b and(a%1+b%1>=1)+f(a/10,b/10)
```
sadly runs into float precision issues.
[Answer]
## JavaScript (ES6), ~~53~~ 45 bytes
```
f=(a,b,d=1)=>a+b<d?0:(a%d+b%d>=d)+f(a,b,d*10)
```
Saved 1 byte by adding an extra do-nothing iteration for carries into 1's place. Saved 7 bytes by appropriating @xnor's carry check. I also had a more elegant 45-byte version but it suffers from floating-point inaccuracy; it would work great translated to a language with exact decimal arithmetic:
```
f=(a,b,c=a+b)=>c<1?0:a%1+b%1-c%1+f(a/10,b/10)
```
[Answer]
# [Python 2](https://docs.python.org/2/), 55 bytes
```
f=lambda a,b,c=0:c+a+b and c+f(a/10,b/10,a%10+b%10+c>9)
```
[Try it online!](https://tio.run/##Tc3BCsIwDAbgu0@Ri6y1VdvpwAy2FxEPaWdx4Loxe5GxZ6@tXkzg5wskZHqHx@jLGF3zpMF0BCSNtI2qrSBhgHwHVjhGR62kyUFbrYTJYVvk0Y0zhPsrQO/hyhBRguYS2AkvEvDHc2L1xzKzSotVxvcmRbZGpbFMo0rNb/UGUk1z7wMrlhX2LSxrcUg/Bwosv5Xg2C6Dcx4/ "Python 2 ‚Äì Try It Online")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~11~~ 10 bytes
```
|DO‚Äö‚Ç¨SO√Ü9√∑
```
[Try it online!](https://tio.run/##MzBNTDJM/f@/xsX/UcOsR01rgv0Pt1ke3v7/v6GlgaGlEZelARACAA "05AB1E ‚Äì Try It Online")
[Answer]
# [Neim](https://github.com/okx-code/Neim), 10 bytes
```
ùî∏ùê£ùê¨‚ÇÅ‚ÇÇùîªùê¨ùïäŒªùïç
```
Explanation:
```
ùî∏            ùî∏ppend the two inputs into a list
 ùê£            ùê£oin them together
  ùê¨           ùê¨um the characters
   ‚ÇÅ‚ÇÇ         Push the first input, then the second
     ùîª        Aùîªd.
      ùê¨       ùê¨um the characters
       ùïä      ùïäubtract
         ùïç    Integer diùïçision by
        Œª     nine (variable)
```
[Try it!](http://178.62.56.56:80/neim?code=%F0%9D%94%B8%F0%9D%90%A3%F0%9D%90%AC%E2%82%81%E2%82%82%F0%9D%94%BB%F0%9D%90%AC%F0%9D%95%8A%CE%BB%F0%9D%95%8D&input=190192%0A90909)
Alternative solution, also 10 bytes:
```
ùî∏Dùê£ùê¨Sùê¨ùê¨ùïä9ùïç
```
Explanation:
```
ùî∏             ùî∏ppend the two inputs into a list
 D            Duplicate
  ùê£            ùê£oin
   ùê¨           ùê¨um
    S          Swap
     ùê¨         ùê¨um
      ùê¨        ùê¨um the characters
       ùïä       ùïäubtract
         ùïç     integer diùïçide by
        Œª       nine (variable)
```
[Try it!](http://178.62.56.56:80/neim?code=%F0%9D%94%B8D%F0%9D%90%A3%F0%9D%90%ACS%F0%9D%90%AC%F0%9D%90%AC%F0%9D%95%8A%CE%BB%F0%9D%95%8D&input=190192%0A90909)
[Answer]
# PHP>=7.1, 81 Bytes
```
for([,$x,$y]=$argv,$i=1;($x+$y)/$i|0;$i*=10)$d+=$c=$x/$i%10+$y/$i%10+$c>9;echo$d;
```
-2 Bytes removing `|0` In this case the loop runs until `$i` is `INF` 
[Test Cases](http://sandbox.onlinephpfunctions.com/code/d47c0f55e9fbbc6779bc835f88ed1061292d5dd4)
[Answer]
# [Braingolf](https://github.com/gunnerwolf/braingolf), 20 bytes
```
VR{.M}d<d&+v+d&+c-9/
```
[Try it online!](https://tio.run/##SypKzMxLz89J@/8/LKhaz7c2xSZFTbtMG0gk61rq////39DSwNDS6L@lARB@zcvXTU5MzkgFAA "Braingolf ‚Äì Try It Online")
Uses the same method as everyone else.
Could've saved a byte or 2 had I had the foresight to allow `d` to use the greedy modifier, then I could've replaced `d<d` with `&d` ah well, next time.
## Explanation
```
VR{.M}d<d&+v+d&+c-9/  Implicit input from commandline args
VR                    Create stack2 and return to stack1
  {..}                Foreach loop, runs on each item in stack1
   .M                 Duplicate and move duplicate to stack2
      d<d             Split both items on stack into digits
         &+           Sum entire stack
           v+         Switch to stack2 and sum last 2 items on stack
             d&+      Split result into digits and sum all digits
                c     Collapse stack2 into stack1
                 -    Subtract last item from 2nd to last
                  9/  Divide by 9
                      Implicit output of last item on stack
```
]