Skip to content

it should be equal to 0 !? #8095

@p0W3RH311

Description

@p0W3RH311

0.4 - 0.3 - 0.1 is equal to zero but is true only for Perl6 ?! why PS not return the correct result...and python ?!!

Steps to reproduce

PS> 0.4 - 0.3 - 0.1 -eq 0
False
PS> 0.4 - 0.3 - 0.1
2.77555756156289E-17
PS> perl6

> 0.4 - 0.3 - 0.1 == 0
True
> 0.4 - 0.3 - 0.1
0
PS> python
>>> 0.4 - 0.3 - 0.1 == 0
False
>>> 0.4 - 0.3 - 0.1
2.7755575615628914e-17

Expected behavior

0

Actual behavior

2.77555756156289E-17

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      6.1.0
PSEdition                      Core
GitCommitId                    6.1.0
OS                             Microsoft Windows 6.3.9600
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-AnsweredThe question is answered.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions