Skip to content

Negative zero not preserved #3144

@tomwhite

Description

@tomwhite

Zarr version

v3.0.8

Numcodecs version

v0.15.1

Python Version

3.11

Operating System

Mac

Installation

pip in a venv

Description

Negative zero (-0.0) is not distinguished from zero when reading back values from a Zarr array. This differs from the expected behaviour (and Zarr Python v2).

Steps to reproduce

# /// script
# requires-python = ">=3.11"
# dependencies = [
#   "zarr@git+https://github.com/zarr-developers/zarr-python.git@main",
# ]
# ///
#
# This script automatically imports the development branch of zarr to check for issues

import numpy as np
import zarr
print(zarr.array(np.array([0.0, -0.0]))[:])
#zarr.print_debug_info()

This prints

[0. 0.]

But with Zarr 2.18.7 it correctly prints

[ 0. -0.]

Additional output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugPotential issues with the zarr-python library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy