PowerShell / PowerShell/PSScriptAnalyzer
add warning or error when using bigint with floating point types
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2.2k
- Forks
- 414
- Avg merge
- 13h 1m
- Merged PRs (30d)
- 2
Description
Summary of the new feature
When you use bigint and add or multiply a floating point number, the result is wrong.
I discussed it with the PowerShell team but they don't want to fix it.
https://github.com/PowerShell/PowerShell/issues/21341
[double]$r = [bigint]5 * [double]1.5
Write-Host "bigint: $r"
The result is "bigint: 5"
[double]$r = [bigint]5 + [double]1.5
Write-Host "bigint: $r"
The result is "bigint: 6"
What is the latest version of PSScriptAnalyzer at the point of writing
1.22.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file, test, or entry point is named. Start by locating the analyzer rule or type-checking entry point for arithmetic expressions, then reproduce the two examples from the issue; done means bigint combined with floating-point addition or multiplication receives a warning or error instead of silently producing the shown incorrect results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100