-
-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AboutNumbers wrong types #474
Comments
Although your observation is correct, there is some obfuscation involved. Essentially "Long" is an alias for the underlying actual datatype. |
It's a legitimate issue.
```powershell
([int]::MaxValue + 200) -is [long]
```
is basically what Pester is doing. Both win PS and pwsh cause addition to
yield a Double. Please may I ask what version of PS you're testing in
Justin? And if you get True for the expression above (I get False because
it does indeed yield a Double).
…On Thu, 2 Mar 2023 at 15:47, Justin Warwick ***@***.***> wrote:
Although your observation is correct, there is some obfuscation involved.
Essentially "Long" is an alias for the underlying actual datatype.
Refer to this page on "Numeric Type Accelerators":
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_numeric_literals?view=powershell-7.3#numeric-type-accelerators
I would expect the -BeOfType parameter to handle this, and indeed it
seems to on my install of PSKoans.
—
Reply to this email directly, view it on GitHub
<#474 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADB3UDVB7MMYMNZQGK6FCA3W2C6JRANCNFSM6AAAAAATFZOL2M>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
PSKoans/PSKoans/Koans/Introduction/AboutNumbers.Koans.ps1
Lines 94 to 99 in 1317701
Is this part correct about numbers getting converted to
long
s?Because no matter, what I try for me it's always a
double
Code:
Output:
Starting with a
short
and increasing it to >MaxValue behaves the same:The text was updated successfully, but these errors were encountered: