1. Project Overview & Quickstart (microsoft/calculator)
File: README.md
Calculator
The Windows Calculator app is a modern Windows app written in C++ and C# that ships pre-installed with Windows.
The app provides standard, scientific, and programmer calculator functionality, as well as a set of converters between various units of measurement and currencies.
Calculator ships regularly with new features and bug fixes. You can get the latest version of Calculator in the Microsoft Store.
Features
- Standard Calculator functionality which offers basic operations and evaluates commands immediately as they are entered.
- Scientific Calculator functionality which offers expanded operations and evaluates commands using order of operations.
- Programmer Calculator functionality which offers common mathematical operations for developers including conversion between common bases.
- Date Calculation functionality which offers the difference between two dates, as well as the ability to add/subtract years, months and/or days to/from a given input date.
- Calculation history and memory capabilities.
- Conversion between many units of measurement.
- Currency conversion based on data retrieved from Bing.
- Infinite precision for basic
arithmetic operations (addition, subtraction, multiplication, division) so that calculations
never lose precision.
Getting started
Prerequisites:
Your computer must be running Windows 11, build 22000 or newer.
Install the latest version of Visual Studio (the free community edition is sufficient).
- Install the "Universal Windows Platform Development" workload.
- Install the optional "C++ Universal Windows Platform tools" component.
- Install the latest Windows 11 SDK.
Install the XAML Styler Visual Studio extension.
Get the code:
textgit clone https://github.com/Microsoft/calculator.gitOpen src\Calculator.slnx in Visual Studio to build and run the Calculator app.
For a general description of the Calculator project architecture see ApplicationArchitecture.md.
To run the UI Tests, you need to make sure that
Windows Application Driver (WinAppDriver)
is installed.
Contributing
Want to contribute? The team encourages community feedback and contributions. Please follow our contributing guidelines.
If Calculator is not working properly, please file a report in the Feedback Hub.
We also welcome issues submitted on GitHub.
Roadmap
For information regarding Windows Calculator plans and release schedule, please see the Windows Calculator Roadmap.
Graphing Mode
Adding graphing calculator functionality is on the project roadmap and we hope that this project can create a great end-user experience around graphing. To that end, the UI from the official in-box Windows Calculator is currently part of this repository, although the proprietary Microsoft-built graphing engine, which also drives graphing in Microsoft Mathematics and OneNote, is not. Community members can still be involved in the creation of the UI, however developer builds will not have graphing functionality due to the use of a mock implementation of the engine built on top of a
common graphing API.
Diagnostic Data
This project collects usage data and sends it to Microsoft to help improve our products and services.
Read our privacy statement to learn more.
Diagnostic data is disabled in development builds by default, and can be enabled with the SEND_DIAGNOSTICS
build flag.
Currency Converter
Windows Calculator includes a currency converter feature that uses mock data in developer builds. The data that
Microsoft uses for the currency converter feature (e.g., in the retail version of the application) is not licensed
for your use. The mock data will be clearly identifiable as it references planets instead of countries,
and remains static regardless of selected inputs.
Reporting Security Issues
Please refer to SECURITY.md.
License
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
File: docs/ApplicationArchitecture.md
Application Architecture
Windows Calculator is a C++/CX application, built for the Universal Windows Platform (UWP).
Calculator uses the XAML UI framework, and the project follows the Model-View-ViewModel (MVVM)
design pattern. This document discusses each of the layers and how they are related to the three Visual Studio projects
that build into the final Calculator application.
Table of Contents
View
The View layer is contained in the Calculator project. This project contains mostly XAML files
and various custom controls that support the UI. App.xaml contains many of the static and
theme resources that the other XAML files will reference. Its code-behind file, App.xaml.cs,
contains the main entry point to the application. On startup, it navigates to the main page.
rootFrame.Navigate(typeof(MainPage), argument)In Calculator, there is only one concrete Page class: MainPage.xaml. MainPage is the root
container for all the other application UI elements. As you can see, there's not much content. MainPage uses aNavigationView control to display the toggleable navigation menu, and empty containers for delay-loaded UI elements.
Of the many modes that Calculator shows in its menu, there are actually only three XAML files that MainPage needs to
manage in order to support all modes. They are:
- Calculator.xaml: This UserControl is itself a container for the Standard,
Scientific, and Programmer modes. - DateCalculator.xaml: Everything needed for the DateCalculator mode.
- UnitConverter.xaml: One
UserControlto support every Converter mode.
VisualStates
VisualStates are used to change the size, position, and appearance (Style) of UI elements
in order to create an adaptive, responsive UI. A transition to a new VisualState is often triggered by specific
window sizes. Here are a few important examples of VisualStates in Calculator. Note that it is not a
complete list. When making UI changes, make sure you are considering the various VisualStates and layouts that
Calculator defines.
History/Memory Dock Panel expansion
In the Standard, Scientific, and Programmer modes, the History/Memory panel is exposed as a flyout in small window sizes.
Once the window is resized to have enough space, the panel becomes docked along the edge of the window.
Scientific mode, inverse function button presence
In the Scientific mode, for small window sizes there is not enough room to show all the function buttons. The mode
hides some of the buttons and provides a Shift (โ) button to toggle the visibility of the collapsed rows. When the
window size is large enough, the buttons are re-arranged to display all function buttons at the same time.
Unit Converter aspect ratio adjustment
In the Unit Converter mode, the converter inputs and the numberpad will re-arrange depending on if the window is in
a Portrait or Landscape aspect ratio.
Data-Binding
Calculator uses data binding to dynamically update the properties of UI elements. If this concept
is new for you, it's also worth reading about data binding in depth.
The x:Bind markup extension is a newer replacement for the older Binding style. You may see both
styles in the Calculator codebase. Prefer x:Bind in new contributions because it has better performance. If you need
to add or modify an existing Binding, updating to x:Bind is a great first step. Make sure to read and understand
the difference between the two styles, as there are some subtle behavioral changes. Refer to the
binding feature comparison to learn more.
ViewModel
The ViewModel layer is contained in the CalcViewModel project. ViewModels provide a source of
data for the UI to bind against and act as the intermediary separating pure business logic from UI components that
should not care about the model's implementation. Just as the View layer consists of a hierarchy of XAML files, the
ViewModel consists of a hierarchy of ViewModel files. The relationship between XAML and ViewModel files is often 1:1.
Here are the notable ViewModel files to start exploring with:
- ApplicationViewModel.h: The ViewModel for MainPage.xaml. This ViewModel
is the root of the other mode-specific ViewModels. The application changes between modes by updating theModeproperty
of theApplicationViewModel. The ViewModel will make sure the appropriate ViewModel for the new mode is initialized. - StandardCalculatorViewModel.h: The ViewModel for Calculator.xaml.
This ViewModel exposes functionality for the main three Calculator modes: Standard, Scientific, and Programmer. - DateCalculatorViewModel.h: The ViewModel for DateCalculator.xaml.
- UnitConverterViewModel.h: The ViewModel for UnitConverter.xaml.
This ViewModel implements the logic to support every converter mode, including Currency Converter.
PropertyChanged Events
In order for data binding to work, ViewModels need a way to inform the XAML framework about
updates to their member properties. Most ViewModels in the project do so by implementing the
INotifyPropertyChanged interface. The interface requires that the class provides a
PropertyChanged event. Clients of the ViewModel (such as the UI), can register for thePropertyChanged event from the ViewModel, then re-evaluate bindings or handle the event in code-behind when the
ViewModel decides to raise the event. ViewModels in the Calculator codebase generally uses a macro, defined in the
Utils.h utility file, to implement the INotifyPropertyChanged interface. Here is a standard
implementation, taken from ApplicationViewModel.h.
[Windows::UI::Xaml::Data::Bindable]
public ref class ApplicationViewModel sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
{
public:
ApplicationViewModel();
OBSERVABLE_OBJECT();The OBSERVABLE_OBJECT() macro defines the required PropertyChanged event. It also defines a privateRaisePropertyChanged helper function for the class. The function takes a property name and raises aPropertyChanged event for that property.
Properties that are intended to be the source for a data binding are also typically implemented with a macro. Here is
one such property from ApplicationViewModel:
OBSERVABLE_PROPERTY_RW(Platform::String^, CategoryName);The OBSERVABLE_PROPERTY_RW macro defines a Read/Write property that will raise a PropertyChanged event if its value
changes. Read/Write means the property exposes both a public getter and setter. For efficiency and to avoid raising
unnecessary PropertyChanged events, the setter for these types of properties will check if the new value is
different from the previous value before raising the event.
From this example, either ApplicationViewModel or clients of the class can simply assign to the CategoryName
property and a PropertyChanged event will be raised, allowing the UI to respond to the new CategoryName value.
Model
The Model for the Calculator modes is contained in the CalcManager project. It consists of three layers: a CalculatorManager, which relies on a CalcEngine, which relies on the Ratpack.
CalculatorManager
The CalculatorManager contains the logic for managing the overall Calculator app's data such as the History and Memory lists, as well as maintaining the instances of calculator engines used for the various modes. The interface to this layer is defined in CalculatorManager.h.
CalcEngine
The CalcEngine contains the logic for interpreting and performing operations according to the commands passed to it. It maintains the current state of calculations and relies on the RatPack for performing mathematical operations. The interface to this layer is defined in CalcEngine.h.
RatPack
The RatPack (short for Rational Pack) is the core of the Calculator model and contains the logic for
performing its mathematical operations (using infinite precision arithmetic
instead of regular floating point arithmetic). The interface to this layer is defined in ratpak.h.
File: docs/ManualTests.md
Calculator Manual Tests
These manual tests are run before every release of the Calculator app.
Smoke Tests
Calculators
Math in Standard Calculator
Test 1
Steps:
- From the Standard Calculator page, input โ3โ, โ+โ, โ3โ, โEnterโ on the keyboard
*Expected: โ6โ shows up in the display * - Input โ4โ, โ-โ, โ2โ, โ=โ using the in-app buttons
Expected: โ2โ shows up in the display
Test 2
Steps:
- From the Standard Calculator page, input โ3โ, โ+โ, โ3โ, โEnterโ on the keyboard
- Navigate to the History pane, and verify that โ3 + 3 = 6โ shows up in the pane
- Input โMSโ using the in-app buttons
- Navigate to the Memory pane
Expected: โ6โ shows up in the pane
Math in Scientific Calculator
Test 1
Steps:
- From the Scientific Calculator page, input โ3โ, โ^โ, โ3โ, โEnterโ on the keyboard
Expected: โ27โ shows up in the display
Test 2
Steps:
- Input โ5โ, โn!โ, โ=โ using the in-app buttons
Expected: โ120โ shows up in the display
Math in Programmer Calculator
Test 1
Steps:
- From the Programmer Calculator page, input โ1โ, โ&โ, โ0โ, โEnterโ on the keyboard
Expected: โ0โ shows up in the display
Test 2
Steps:
- Input โ15โ using the in-app buttons and select โHEXโ
Expected: โFโ shows up in the display and the letters A-F show up as in-app buttons
Converters
Converter Usage
Steps:
- From the Length Converter page, select โkilometersโ as the unit type in the input field and input โ5โ using the keyboard
- Select โmilesโ as the unit type in the output field
Expected: The output starts with is โ3.106856โ
Always-on-Top
Test 1
Steps:
- Launch the "Calculator" app and navigate to "Standard" Calculator
Expected: Always-on-Top button's tooltip says "Keep on top" - Click the Always-on-Top button
Expected: Always-on-Top button's tooltip now says "Back to full view" - Launch the "Notepad" app and put it in full-screen mode
Expected: Calculator is still on top of Notepad and in Always-on-Top mode
Test 2
Steps:
- Launch the "Calculator" app and from "Standard" Calculator, input โ3โ, โ+โ, โ3โ (do not press โEnterโ)
- Tab over the Always-on-Top button and press "Enter" on the keyboard
Expected: The application title, hamburger menu, calculator type title, calculation expression (the secondary line above the main display), history button and memory buttons are no longer visible. The main display shows "3" - Press โEnterโ
Expected: The main display shows "6" - Press "Ctrl-H" on the keyboard
Expected: Nothing happens (history keyboard shortcuts are disabled) - Press "Ctrl-P" on the keyboard, then tab over the Always-on-Top button and press "Enter" on the keyboard again
- Open the Memory panel
Expected: Nothing is stored in memory (memory keyboard shortcuts are disabled in Always-on-Top mode) and "6" is in history
Test 3
Steps:
- Launch the "Calculator" app and from "Standard" Calculator, click the Always-on-Top button
- Resize the window horizontally
Expected: The buttons automatically expand or shrink to fit the available screen size - Resize the window vertically
Expected: The buttons automatically expand or shrink to fit the available screen size and the percent, square-root, squared and reciprocal buttons disappear when the screen height is small - Click the Always-on-Top button again
Expected: Calculator is in Standard mode and the original window layout from before Step 1 is restored - Click the Always-on-Top button again
Expected: Calculator is in Always-on-Top mode and the window size from after Step 3 is restored - Close the "Calculator" app
- Launch the "Calculator" app again and click the Always-on-Top button
Expected: The window size from right before closing from Always-on-Top mode (ie. after Step 5) is restored
Test 4
Steps:
- Launch the "Calculator" app and from "Standard" Calculator, click the Always-on-Top button
- Input "/", "0", โEnterโ on the keyboard
Expected: "Result is undefined" is displayed in the system default app language - Click the Always-on-Top button again
*Expected: Calculator is in Standard mode and all operator (except for "CE", "C", "Delete" and "=") and memory buttons are disabled
Test 5
Steps:
- Launch the "Calculator" app and navigate to "Scientific" Calculator
Expected: The Always-on-Top button is hidden - Navigate to "Standard" Calculator
Expected: The Always-on-Top button is visible
Basic Verification Tests
Launch App Test
Steps:
- Press the Windows key.
- Navigate to "all apps".
- Look for "Calculator".
- Click to launch the "Calculator" app.
Expected: The calculator app launches gracefully.
All Calculators Test: Verify All Numbers & Input Methods
Steps:
- Launch the "Calculator" app.
- Navigate to "Standard" Calculator.
- Mouse Input
Expected: All numbers work via mouse click. - Keyboard Input:
Expected: All numbers work via number pad. - Navigate to "Scientific" Calculator and Repeat Steps 3-5
Expected: Steps 3-5 pass in Scientific mode - Navigate to "Programmer" Calculator and Repeat Steps 3-5
Expected: Steps 3-5 pass in Programmer mode
All Calculators Test: Verify Basic Arithmetic Functions
Steps:
- Launch the "Calculator" app.
- Navigate to "Standard" Calculator.
- Using the Number Pad and Mouse perform the following arithmetic functions and verify the result.
a. (+) Addition
b. (-) Subtraction
c. (x) Multiplication
d. (รท) Division
e. (1/x) Reciprocal
f. (โ) Square Root
g. (xยฒ) Squared
h. (xยณ) Cubed
i. (%) Percent
j. (ยฑ) Positive / Negative
k. (=) Equals
l. Delete Button (flag with x in it)
m. [CE] Clear
n. [C] Global Clear
o. (.) Decimal - Navigate to "Scientific" Calculator and Repeat Steps 3-19.
- Navigate to "Programmer" Calculator and Repeat Steps 3-18 (No Decimal in Programming Calc).
Scientific Calculator Test: Verify advanced arithmetic functions
Steps:
- Launch the "Calculator" app.
- Navigate to "Scientific" Calculator.
- Using the Number Pad and Mouse perform the following arithmetic functions and verify the result.
a. (xสธ) Xth Power of Y
b. (yโx) Y Root of X
c. (10หฃ) 10 Power of X
d. (ex) E Power of X
e. (ฯ) Pi
f. (n!) Factorial
g. (Ln) Natural Logarithm
h. (Log) Logarithm
i. (Exp) Exponential
j. (dms) Degrees, Minutes, Seconds
k. (deg) Degrees
l. (Mod) Modulo
m. โ( )" Parenthesis
All Calculators Test: Verify memory functions
Steps:
- Launch the "Calculator" app.
- Navigate to "Standard" Calculator.
- Perform a calculation and press the MS button.
- If small scale, Select the (M) with the drop down arrow
Expected: Calculation from previous step is present. - Click the (M+) Add to Memory.
Expected: Previous calculation is added to itself. - Click the (M-) Subtract from Memory.
Expected: Previous calculation is subtracted from the base calculation. - Click the (MR) Memory Recall.
Expected: Previous calculation is made primary (This is not available in the Programmer mode). - Check the MC button.
Expected: The stored information is cleared. - Navigate to "Scientific" Calculator and Repeat Steps 3-8.
Expected: All in "Scientific" mode. - Navigate to "Programmer" Calculator and Repeat Steps 3-8.
Expected: All in "Programmer" mode.
Scientific Calculator Test: Verify trigonometric functions
Steps:
- Launch the "Calculator" app.
- Navigate to "Scientific" Calculator.
- Using the Number Pad and Mouse perform the following trigonometric functions and verify the result.
- Sine (sin)
- Cosine (cos)
- Tangent (tan)
- Inverse Sine (sin-1)
- Inverse Cosine (cos-1)
- Inverse Tangent (tan-1) Inverse Tangent:
- Press (HYP) for Hyperbolic trig functions:
Expected: Trig function buttons show hyperbolic trig functions. - Hyperbolic Sine (sinh)
- Hyperbolic Tangent (tanh)
- Hyperbolic Cosine (cosh)
- Inverse Hyperbolic Sine (sinh-1)
- Inverse Hyperbolic Tangent (tanh-1)
- Inverse Hyperbolic Cosine (cosh-1)
Programmer Calculator Test: Verify logical functions
Steps:
- Launch the "Calculator" app
- Navigate to "Programmer" Calculator.
- Using the Number Pad and Mouse perform the following trigonometric functions and verify the result.
- Rotate Left (RoL) Logical Operator:
01011001 rol 3 = 11001010. - Rotate Right (RoR) Logical Operator:
01011001 RoR 3 = 00101011. - (Lsh) Logical Operator:
(10 multiplied by 2 three times)
10 Lsh 3 = gives 80.
10.345 Lsh 3 = also gives 80. - (Rsh) Logical Operator:
(16 divided by 2 twice)
16 Rsh 2 = gives 4.
16.999 Rsh 2 = also gives 4. - (Or) Logical Operator
101 OR 110 = gives 111. - Exclusive Or (Xor) Logical Operator:
101 XOR 110 = gives 11. - (Not) Logical Operator
NOT 1001100111001001 =
0110011000110110. - (And) Logical Operator
101 AND 110 = gives 100. - (Mod) Logical Operator
Remainder of integer division (Modulo x) - "( )" Parenthesis
All Calculators and Converters Test: Verify scaling functions and languages
Steps:
- Launch the "Calculator" app.
- For All Modes: While scaling in both directions to capacity
Expected: Elements like Memory and History are shifted or integrated appropriately. - In Any Mode: While at the Smallest scale, Select the Menu Button
Expected: The menu items are scrollable with nothing overlapping. - While in the Menu: Check the About Page
Expected: Everything in the about page fits into its window - For Scientific Mode: At a Larger Scale
Expected: All buttons are present and the 2nd button is grayed out. - For Scientific Mode: At a Smaller Scale
Expected: All buttons are present and the 2nd button is able to be toggled. - For Programmer Mode: At a Any Scale
Expected: All buttons are present and the 2nd button is able to be toggled. - For Converter Mode: While Scaling
Expected: The number pad and input areas move around each other gracefully. - For Graphing Mode: While Scaling
Expected: The number pad, graph area, and input areas move around each other gracefully. - Changing Language: Open Settings app > Time & language > Region & language > Add a language > Select a Right to Left (RTL) language such as Hebrew > Install the associated files> Set it to the system default.
- Set the system number format preference: Open a Run dialog (WIN + R) > type โintl.cplโ > Enter > In the format dropdown list > Select Hebrew > Apply.
- Initiating the change: Package has completed installing > Sign out > Sign in. (This change to the app may also require a reinstallation of the build)
- Repeat Steps 2-6 again in a (RTL) language.
Expected: No elements fall out of intended boundaries.
All Calculators Test: Verify toggling functions
Steps:
- Launch the "Calculator" app.
- For Standard & Scientific Modes: While in the Smallest scale, verify that the History Icon brings up the history panel gracefully and is displayed appropriately.
For Scientific Mode: At a Smaller Scale
Verify the following: - Grad / Deg / Rad
Perform a trig function
Expected: The answer to the function is in the selected grad/deg/rad. Repeat for each of the modes. - (Hyp) Hyperbolic
Expected: Sin toggles to Sinh, Cos toggles to Cosh, Tan toggles to Tanh. - (F-E key) Floating Point Notation & Scientific Notation.
Expected: Display toggles between floating point and Scientific notation.
For Programmer Mode
Verify the following: - "Bit Toggling Keypad":
Expected: In app keypad changes to represent Bits (1s and 0s). - "QWORD / DWORD / WORD / BYTE":
Expected: Toggles as expected. - "Hex" Hexadecimal:
Expected: A B C D E F become active and user can use them. A maximum of 16 characters can be entered. - "Dec" Decimal:
Expected: A B C D E F are inactive. A maximum of 19 characters can be entered. - "Oct" Octal:
Expected: A B C D E F 8 9 are inactive. A maximum of 22 characters can be entered. - "Bin" Binary:
Expected: A B C D E F 2 3 4 5 6 7 8 9 are inactive. A maximum of 64 characters can be entered.
Graphing Mode Test: Verify Graphing mode functions
Steps:
- Launch the "Calculator" app
- Navigate to "Graphing" Calculator
- Enter a function of x in the input field
Expected: Function is plotted in the graph area. Line color matches the colored square next to the input field - Select the "+" button below the function input and enter more functions in the fields that appear
Expected: All functions are plotted in the graph area and match the colors of the input field squares - Select the colored square for any function
Expected: Visibility of the function in the graph is toggled off/on - Select the "Zoom In", "Zoom Out", and "Reset View' buttons in the graph area
Expected: Both X and Y axes zoom in, out, and revert to default settings, respectively - Select the Trace button, then click + drag the graph until the red square is near a graphed function
Expected: Closest (X, Y) coordinates of the function to the red square are displayed with a black dot to indicate the location - Enter "y=mx+b" into a function input field, then select "Variables" button
Expected: y=x+1 function is plotted in the graph, "Variables" modal window shows two variables "m" and "b" with values set to 1. - Adjust the value, minimum, maximum, and step for each variable
Expected: y=mx+b graph adjusts to the new values for m and b, step size changes the increments of the slider for each value - Share the graph via OneNote, Outlook/Mail, Twitter, and Feedback Hub
Expected: Modifiable message that contains an image of the graph customized for the chosen application opens - Verify Key Graph Features tab shows the correct information for the following functions:
(Note: IP = Inflection Points, VA = Vertical Asymptotes, HA = Horizontal Asymptotes, OA = Oblique Asymptotes)
a. y=x
Expected: Domain: โ ๐ฅโโโ; Range: โ yโโโ; X/Y Intercepts: (0)/(0); Max: none; Min: none; IP: none; VA: none; HA: none; OA: none; Parity: Odd; Monotonicity: (-โ, โ) Increasing
b. y=1/x
Expected: Domain: โ ๐ฅโ 0โ; Range: โ yโโ{0}โ; X/Y Intercepts: รธ/รธ; Max: none; Min: none; IP: none; VA: x=0; HA: y=0; OA: none; Parity: Odd; Monotonicity: (0, โ) Decreasing, (-โ, 0) Increasing
c. y=x^2
Expected: Domain: โ ๐ฅโโโ; Range: โ yโ{0, โ)โ; X/Y Intercepts: (0)/(0); Max: none; Min: (0,0); IP: none; VA: none; HA: none; OA: none; Parity: Even; Monotonicity: (0, โ) Increasing, (-โ, 0) Decreasing
d. y=x^3
Expected: Domain: โ ๐ฅโโโ; Range: โ yโโโ; X/Y Intercepts: (0)/(0); Max: none; Min: none; IP: (0,0); VA: none; HA: none; OA: none; Parity: Odd; Monotonicity: (-โ, โ) Increasing
e. y=e^x
Expected: Domain: โ ๐ฅโโโ; Range: โ yโ(0, โ)โ; X/Y Intercepts: รธ/(1); Max: none; Min: none; IP: none; VA: none; HA: y=0; OA: none; Parity: none; Monotonicity: (-โ, โ) Increasing
f. y=ln(x)
Expected: Domain: โ ๐ฅ>0โ; Range: โ yโโโ; X/Y Intercepts: (1)/รธ; Max: none; Min: none; IP: none; VA: x=0; HA: none; OA: none; Parity: none; Monotonicity: (0, โ) Increasing
g. y=sin(x)
Expected: Domain: โ ๐ฅโโโ; Range: โ ๐ฆโ[โ1,1]โ; X/Y Intercepts: (โ ๐n1,n1โโคโ)/(0); Max: โ (2๐n1+๐/2,1),n1โโคโ; Min: โ (2๐n1+3๐/2,โ1),n1โโคโ; IP: โ (๐n1,0),n1โโคโ; VA: none; HA: none; OA: none; Parity: Odd; Monotonicity: โ (2๐n1+๐/2,2๐n1+3๐/2),n1โโคโ Decreasing; โ (2๐n1+3๐/2,2๐n1+5๐/2),n1โโคโ Increasing; Period: 2๐
h. y=cos(x)
Expected: Domain: โ ๐ฅโโโ; Range: โ ๐ฆโ[โ1,1]โ; X/Y Intercepts: (โ ๐n1+๐/2,n1โโคโ)/(1); Max: โ (2๐n1,1),n1โโคโ; Min: โ (2๐n1+๐,-1),n1โโคโ; IP: โ (๐n1+๐/2,0),n1โโคโ; VA: none; HA: none; OA: none; Parity: Even; Monotonicity: โ (2๐n1+๐,2๐n1+2๐),n1โโคโ Increasing, โ (2๐n1,2๐n1+๐),n1โโคโ Decreasing; Period: 2๐
i. y=tan(x)
Expected: Domain: โ xโ ๐n1+๐/2,โn1โโคโ; Range: โ ๐ฆโโโ; X/Y Intercepts: (x=๐n1, n1 โโค)/(0); Max: none; Min: none; IP: x=๐n1, n1 โโค; VA: x=๐n1+๐/2, n1โโค; HA: none; OA: none; Parity: Odd; Monotonicity: โ (๐n1+๐/2,๐n1+3๐/2),n1โโคโ Increasing; Period: ๐
j. y=sqrt(25-x^2)
Expected: Domain: โ xโ[-5,5]โ; Range: โ ๐ฆโ[0,5]โ; X/Y Intercepts: (5),(-5)/(5); Max: (0,5); Min: (-5,0) and (5,0); IP: none; VA: none; HA: none; OA: none; Parity: Even; Monotonicity: (0,5) Decreasing, (-5,0) Increasing
k. y=(-3x^2+2)/(x-1)
Expected: Domain: โ xโ 1โ; Range: โ ๐ฆโ(-โ, -2โ3 - 6}U{2โ3 -6,โโ; X/Y Intercepts: (-โ6/3),(โ6/3)/(-2); Max: โ (โ3/3+1,-2โ3โ6)โ; Min: โ (โโ3/3+1,2โ3โ6)โ; IP: none; VA: x=1; HA: none; OA: y=-3x-3; Parity: none; Monotonicity: (โ3/3+1,โ) Decreasing, (1,โ3/3+1,) Increasing(-โ3/3+1,1), Increasing, (-โ,-โ3/3+1) Decreasing
l. y=sin(sin(x)) ("too complex" error test)
Expected: Domain: โ ๐ฅโโโ; Range: Unable to calculate range for this function; X/Y Intercepts: none; Max: none; Min: none; IP: none; VA: none; HA: none; OA: none; Parity: odd; Monotonicity: Unable to determine the monotonicity of the function
These features are too complex for Calculator to calculate: Range, X Intercept, Period, Minima, Maxima, Inflection Points, Monotonicity
m. y=mx+b
Expected: Analysis is not supported for this function
Date Calculation Test: Verify dates can be calculated.
Steps:
- Launch the "Calculator" app
- Navigate to "Date Calculation" Calculator
- With "Difference between dates" Selected
Change the various date input fields
Expected: From and To reflect dates input respectively. - With "Add or Subtract days" Selected
Change the various date input fields
Expected: Verify changes made to both add and subtract reflect input respectively.
Currency Converter Test: Verify conversion & updating current currency rates.
Steps:
- Launch the "Calculator" app.
- Navigate to "Currency Converter" Calculator.
- Select 2 Currency types from the dropdowns & enter a "1" into a conversion slot.
Expected: The currency is slotted properly and converted rate matches the ratio provided under the selected currency types. - Click "Updated"
Expected: Display matches PC's date and time. - After at least a minute: Select "Update rates" & Check "Updated" again:
Expected: The "Update Rates" button changes the date and time to match the computer's current date and time.
All Calculators Test: Hotkeys: Verify Hot Key function.
Steps:
Launch the "Calculator" app.
For All Applicable Modes verify the following (note: only 11-15 and 20 work in Always-on-Top mode):
Press Alt +1 to enter "Standard" mode
Expected: Move to "Standard" screen.Press Alt +2 to enter "Scientific" mode
Expected: Move to "Scientific" screen.Press Alt +3 to enter "Programmer" mode
Expected: Move to "Programming" screen.Press Alt +4 to enter "Date Calculation" mode
Expected: Move to "Date Calculation" screen.
6 Press Alt +5 to enter "Graphing" mode
Expected: Move to "Graphing" screen.Press Ctrl +M to Store in Memory
Press Ctrl +P to Add to Active Memory
Press Ctrl +Q to Subtract form Active Memory
Press Ctrl +R to Recall from Memory
Press Ctrl +L to Clear from Memory
Press Delete to Clear Current Input 'CE'
Press Esc to Full Clear Input 'C'
Press F9 to Toggle 'ยฑ'
Press R to Select '1/x'
Press @ to Select 'โ'
Press Ctrl + H to Toggle History Panel
Expected: Function when in small scale window.Press Up arrow to Move up History Panel
Expected: Function when in small scale window.Press Down arrow to Move Down History Panel
Expected: Function when in small scale window.Press Ctrl + Shift + D to Clear History Panel
Expected: Function when in small scale window.Press Spacebar to Repeat Last Input
Verify the following in Scientific Mode
Press F3 to Select 'DEG'
Press F4 to Select 'RAD'
Press F5 to Select 'GRAD'
Press Ctrl +G to Select '10หฃ'
Press Ctrl +Y to Select 'yโx'
Press Shift +O to Select 'sin-1'
Press Shift + S to Select 'cos-1'
Press Shift +T to Select 'tan-1'
Press Ctrl +O to Select 'Cosh'
Press Ctrl +S to Select 'Sinh'
Press Ctrl +T to Select 'Tanh'
Press D to Select 'Mod'
Press L to Select 'log'
Press M to Select 'dms'
Press N to Select 'ln'
Press Ctrl +N to Select 'ex'
Press O to Select 'Cos'
Press P to Select 'ฯ'
Press Q to Select 'xยฒ'
Press S to Select 'Sin'
Press T to Select 'Tan'
Press V to Toggle 'F-E'
Press X to Select 'Exp'
Press Y or ^ to Select 'xสธ'
Press # to Select 'xยณ'
Press ! to Select 'n!'
Verify the following in Programmer Mode
Press F2 to Select 'DWORD'
Press F3 to Select 'WORD'
Press F4 to Select 'BYTE'
Press F5 to Select 'HEX'
Press F6 to Select 'DEC'
Press F7 to Select 'OCT'
Press F8 to Select 'BIN'
Press F12 to Select 'QWORD'
Press A-F to Input in HEX
Press J to Select 'RoL'
Press K to Select 'RoR'
Press < to Select 'Lsh'
Press > to Select 'Rsh'
Press % to Select 'Mod'
Press | to Select 'Or'
Press ~ to Select 'Not'
Press & to Select 'And'
Verify the following in Graphing Mode
Press x to Select 'x'
Press y to Select 'y'
Press Ctrl +[Numpad+] to Select 'Zoom In'
Press Ctrl +[Numpad-] to Select 'Zoom Out'
Localization Tests
Always-on-Top
Test 1
Steps:
- Change the system default app language to Arabic
- Launch the "Calculator" app and from "Standard" Calculator, click the Always-on-Top button
Expected: UI/Menu is localized (for example, the title bar buttons is in right-to-left order) - Input "/", "0", โEnterโ on the keyboard
Expected: Error message is in Arabic
Ease of Access Tests
Always-on-Top
Test 1
Steps:
- Open the "Narrator" app
- Launch the "Calculator" app and from "Standard" Calculator, click the Always-on-Top button
- Tab over the Always-on-Top button
Expected: Narrator reads the localized version of "Back to full view" - Tab over the main results field
Expected: Narrator reads the localized version of exactly what's displayed (ie. "0") - Tab over the rest of the UI elements
Expected: Narrator reads the localized version of the UI elements' contents
File: docs/NewFeatureProcess.md
New feature process
Where do I submit my idea for a new feature?
The easiest way to submit new feature requests is through
Feedback Hub.
In Feedback Hub, any Windows user (even if they aren't on GitHub) can upvote suggestions. The
Calculator team reviews these suggestions regularly, and when we're ready to work on an idea we
create feature pitch issues here on GitHub.
But using Feedback Hub is not required—you can create feature pitches too! This document
explains the elements of a good pitch and how we'll guide features from a pitch to a finished
product. The Feature Tracking board shows
all the features we're working on and where they're at in the process.
Do I need to follow this process? Can I just start coding and submit a PR?
You do not need to follow this process for bug fixes, performance improvements, or changes to the
development tools. To contribute these changes,
discuss the proposed change in an issue
and then submit a pull request.
You do need to follow this process for any change which "users will notice". This applies
especially to new features and major visual changes.
Step 1: Feature pitch
Feature pitches are submitted as issues on GitHub using the
Feature Request template.
We encourage discussion on open issues, and as discussion progresses we will edit the issue description to refine the
idea until it is ready for review.
We review pitches regularly, and will approve or close issues based on whether they broadly align with the
Calculator roadmap. Approved pitches are moved
into planning on the feature tracking board.
Step 2: Planning
For most features, the output of this phase is a specification which describes how the feature will work, supported by
design renderings and code prototypes as needed. The original issue will continue to track the overall progress of the
feature, but we will create and iterate on spec documentation in the
Calculator Spec repo. Sometimes we'll learn new things about a feature
proposal during planning, and we'll edit or close the original pitch.
We welcome community participation throughout planning. The best ideas often come from trying many ideas during
the planning phase. To enable rapid
experimentation, we encourage developing and sharing rough ideas—maybe even with pencil and
paper—before making designs pixel-perfect or making code robust and maintainable.
After the spec review is completed, we will move the issue
into implementation on the feature tracking board. In some cases,
all of the details of an idea can be captured concisely in original feature pitch. When that happens, we may move ideas
directly into implementation.
Step 3: Implementation
A feature can be implemented by the original submitter, a Microsoft team member, or by other
community members. Code contributions and testing help are greatly appreciated. Please let everyone know if you're
actively working on a feature to help avoid duplicated efforts from others.
You might be able to reuse code written during the prototype process, although there will typically
be more work required to make the solution robust. Once the code is ready, you can begin
submitting pull requests.
Technical review
As with all changes, the code for new features will be reviewed by a member of the Microsoft team
before being checked in to the master branch.
New features often need a more thorough technical review than bug fixes. When reviewing code for
new features, the Microsoft team considers at least these items:
- All items on the Accessibility checklist
should be addressed. - All items on the Globalization checklist
should be addressed. - The change should be tested on the oldest version of Windows that the app supports. You can
find this version number in AppxManifest.xml. Any calls to APIs newer than that version should be
conditionally enabled. - The change should use only supported APIs. If there are any questions about whether legacy or
undocumented APIs are in use, the Windows App Certification Kit
should be run to check. - The change should save the user's progress if the app is
suspended and resumed.
Code to handle these cases should be
tested in the Visual Studio debugger. - If the change has customizations for particular device families,
it should be tested on those device families. - The change should be tested with the app window resized to the smallest possible size.
- The change should be tested with light, dark, and high contrast themes. It should honor the
user's preferred accent color. - If the change adds new libraries or other dependencies:
- If the library is packaged with the app, the increased size of the binaries should be
measured. - If the library is not maintained by Microsoft, the Microsoft team will need to set up a
plan to monitor the upstream library for changes like security fixes. - If the library is being used under an open-source license, we must comply with the license
and credit third parties appropriately.
- If the library is packaged with the app, the increased size of the binaries should be
- If the change adds code which runs during the app's startup path, or adds new XAML elements
which are loaded at startup:- Run the perf tests to measure any increase in startup time. Move work out of the startup
path if possible.
- Run the perf tests to measure any increase in startup time. Move work out of the startup
- If the change adds additional logging:
- All logging should use
TraceLogging. - Unnecessary log events should be removed, or configured so that they are collected only when
needed to debug issues or measure feature usage.
- All logging should use
- If the change reads user data from files or app settings:
- Verify that state saved in a previous version of the app can be used with the new version.
- If the change makes network requests:
- Microsoft must plan to keep these dependencies secure and functional for the lifetime of
the app (which might be several years). - The app should be fully functional if some network requests are slow or fail. Tools like
Fiddler
can be used to simulate slow or failed requests.
- Microsoft must plan to keep these dependencies secure and functional for the lifetime of
Step 4: Final product review and merge to master
After the technical review is complete, the product team will review the finished product to make
sure the final implementation is ready to release to Windows customers.
File: docs/Roadmap.md
Windows Calculator Roadmap
Windows Calculator is under active development by Microsoft.
Focus
In 2021, the Windows Calculator team is focused on:
- Iterating upon the existing app design based on the latest guidelines for Fluent Design and WinUI.
- Unblocking community contributions by identifying and addressing bottlenecks affecting developers, including:
- [Your feature idea here] - please review our new feature development process to get started!
We welcome contributions of all kinds from the community, but especially those that support the efforts above. Please see our contributing guidelines for more information on how to get involved.
Releases
Windows Calculator is included in every Windows 10 release as a provisioned Windows app. We also deliver updates through the Microsoft Store approximately monthly.
2. Official Technical Reference & Guides (microsoft/microsoft.github.io)
[microsoft.github.io](https://microsoft.github.io)
Many open source projects released by Microsoft products, services and teams also have
deployments powered by GitHub Pages on this domain.
To discover Microsoft-released open source projects, learn about Microsoft's open source
approach and other information, check us out online at opensource.microsoft.com.
If we can help answer questions about the open source program at Microsoft, you can
contact opensource at microsoft com - although we are not able to provide support
for projects through this mechanism.
Microsoft GitHub resources
- Default repo templates including
SECURITY.MDand code of conduct files: microsoft/repo-templates - Code of Conduct (FAQ)
Microsoft open source resources
Resources for Microsoft employees
How to identify an official Microsoft organization on GitHub
- Official Microsoft GitHub orgs have a professional avatar and include a web address at Microsoft.com or an associated official domain
- Official Microsoft orgs are Verified on GitHub - look for the domain verification indicator on GitHub