Memory functions
The Rust WASM Calculator has one memory register, a single 64-bit float held in the Rust Calculator struct alongside the working value. Four buttons drive it: MS, MR, MC, and M+. The register survives pressing C, because clearing resets the working value only. The current contents are shown above the display at all times, so you never have to press MR just to find out what is stored.
Clear does not clear memory
Pressing C resets the working value to zero and cancels any pending operator, but it deliberately leaves the memory register alone. This is the behaviour of most desktop and pocket calculators, and it is asserted directly by one of the crate's unit tests: the test stores a value, presses clear, and checks that the register still holds it. If you want the register empty, press MC.
Starting state
A freshly loaded page starts with a working value of zero, a memory register of zero, and an empty history. Reloading the page rebuilds the Rust Calculator from scratch, so nothing persists between visits. The calculator writes nothing to local storage, cookies, or any server.
Questions and answers
Does pressing C erase the calculator memory?
No. C resets the display and the working value but leaves the memory register intact. Press MC to clear the register.
How do I subtract from memory when there is no M minus button?
Enter a negative number and press M+. Memory add accumulates, so adding a negative value subtracts from the register.
Is the memory register saved when I close the tab?
No. The register lives only in the WebAssembly module's memory for the lifetime of the page. Reloading resets it to zero.