The calculator app is open source so you can see the code here: https://github.com/microsoft/calculator