microsoft / microsoft/PowerToys
PowerToys Command Panel & Calculator: "e" is incorrectly cached as "e - 1" or "e - 2" or other value after certain operations
- Dominant language
- C
- Stars
- 139k
- Forks
- 8.6k
- PR merge metrics
- PR metrics pending
Description
### Microsoft PowerToys version
0.97.0
### Installation method
Microsoft Store
### Area(s) with issue?
Command Palette
### Steps to reproduce
When using the PowerToys Run calculator (triggered by =), the constant e (Euler's number) sometimes gets stuck as e - 1 (≈0.71828) instead of the correct value ≈2.71828.
In some cases, after further misuse, it can even become a random negative number like -169.28.
This appears to be a caching bug: the internal variable e is mistakenly overwritten with e - 1( sometime is e - 2 , even other value)) and persists across calculations.
在 PowerToys Run 计算器(输入 = 触发)中,数学常数 e 有时会错误地变成 e - 1(约 0.71828)而不是正确的 2.71828。
某些错误操作后,甚至会变成负值(如 -169.28)。
这看起来是一个缓存 bug:内部变量 e 被错误覆盖为 e - 1(有时为e-2甚至其他更加错误的值),并且会“粘住”(除非退出,否则e的值永久变更)。
Steps to Reproduce / 重现步骤
Open PowerToys Run (L Alt+Space)
Type = to enter calculator mode
Enter a complex expression with e and multiple unary minus signs, for example:
this: (-(--334e-12) / (900e---1))
Now type "e" and check the value of "e"
May it will actual output: 0.7182818285 (incorrect, should be 2.71828…)
打开 PowerToys Run(L Alt+space)
输入 = 进入计算器模式
输入一个包含 e 和多重负号的复杂表达式,例如:
输入
(-(--334e-12) / (900e---1))
此时单独输入 e 并回车
实际输出:0.7182818285(错误,e默认应为 2.71828…)
### ✔️ Expected Behavior
e should always evaluate to 2.718281828459045… (Euler's number), unaffected by previous calculations.
e 应始终计算为自然常数 2.718281828459045…,不受之前的计算影响。
### ❌ Actual Behavior
After the above expression, e returns e-2 (≈0.71828) or e-1 and even other value.
The wrong value persists even after closing and reopening PowerToys Run
my way to solve: Deleting cache files restores correct behavior temporarily
执行上述表达式后,e 返回 e-2(约 0.71828)或者 e-1 甚至其他乱七八杂的值
即使关闭并重新打开 PowerToys Run,错误值依然保持
删除缓存文件(可临时恢复正确行为)
### Upload Bug Report ZIP-file
_No response_
### Additional Information
Windows 11 25h2
CPU: Amd 7745hx GPU:4050laptop
mem: 16 + 512gb
.net version info:
C:\Users\Admin>dotnet --info
.NET SDK:
Version: 10.0.107
Commit: b16286c228
Workload version: 10.0.100-manifests.ef86bccd
MSBuild version: 18.0.11+b16286c22
运行时环境:
OS Name: Windows
OS Version: 10.0.26200
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\10.0.107\
已安装 .NET 工作负载:
没有要显示的已安装工作负载。
已配置为在安装新清单时使用 workload sets。
未安装任何 workload sets。运行 “dotnet workload restore” 以安装工作负载集。
Host:
Version: 10.0.7
Architecture: x64
Commit: b16286c228
.NET SDKs installed:
3.1.426 [C:\Program Files\dotnet\sdk]
6.0.428 [C:\Program Files\dotnet\sdk]
7.0.410 [C:\Program Files\dotnet\sdk]
10.0.107 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.26 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.26 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 10.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
None
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
### Other Software
none
Contributor guide
Research direction
Start in the PowerToys Run calculator reached with = after opening PowerToys Run with Alt+Space, and reproduce the supplied expression involving multiple unary minus signs. Trace how calculator results are cached and verify that the e constant remains 2.718281828459045 across subsequent calculations and after reopening the calculator.
Written by the indexing model from the issue text.
Assessment
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100