Skip to content

Unexpected -0.0 #145108

@bajinsheng

Description

@bajinsheng

Describe the problem

Some mathematical calculations return negative zeros, which seems unexpected.

To Reproduce

testdb=> select 0 * -69.5;
 ?column? 
----------
     -0.0
(1 row)

Expected behavior
The result should be 0.0 without negative symbol.

Environment:

  • CockroachDB version [7625d9f]
  • Server OS: [Linux/Ubuntu]
  • Client app [psql]

Jira issue: CRDB-49710

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.O-communityOriginated from the communityS-3-ux-surpriseIssue leaves users wondering whether CRDB is behaving properly. Likely to hurt reputation/adoption.T-sql-queriesSQL Queries Teambranch-release-22.1Used to mark GA and release blockers, technical advisories, and bugs for 22.1

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions