Skip to content
Novus Examples
csv588 B

Signed Zero Round-Trip Through Text (.csv)

Nine ways of writing zero, what each parses to, and what dividing one by the result gives. Negative zero compares equal to positive zero yet behaves differently in division and in sign propagation, so a formatter that drops the sign changes results without changing any comparison.

Preview — first 11 linescsv
written_form,parses_to,sign_bit,equals_positive_zero,one_over_x,notes
0,0.0,0,true,Infinity,plain positive zero
-0,-0.0,1,true,-Infinity,negative zero: equal but not identical
0.0,0.0,0,true,Infinity,same as 0
-0.0,-0.0,1,true,-Infinity,same as -0
+0.0,0.0,0,true,Infinity,leading plus is legal in most parsers
-0.0e0,-0.0,1,true,-Infinity,exponent form keeps the sign
-1e-400,-0.0,1,true,-Infinity,"underflows to negative zero, not to 0"
−0.0,parse error,n/a,n/a,n/a,U+2212 MINUS SIGN is not ASCII hyphen-minus
-0,-0.0,1,true,-Infinity,duplicate row: round-tripping must keep the sign

Specifications

Rows
9
Columns
6
Includes Unicode Minus
true
Unicode Minus Codepoint
U+2212
Key Fact
-0.0 == 0.0 is true, but 1/-0.0 is -Infinity
Underflow Case
-1e-400

Testing contract

Expected to recover
Scenario
Parse every written_form, inspect the sign bit of the result, and format it back to text.
Expected result
The six negative forms retain a set sign bit and format back with a leading minus, -1e-400 underflows to negative zero rather than positive zero, and the U+2212 row fails to parse in a strict ASCII float parser.

What is a .csv file?

CSV (Comma-Separated Values) is a plain-text tabular format where rows are lines and fields are separated by commas, with quoting rules for values that contain delimiters, quotes, or newlines. It has no formal type system and depends on encoding and dialect conventions. It is the most portable format for tabular data exchange.

How to use this file

Use an example CSV to test parsers against quoting and embedded-delimiter edge cases, header handling, encoding detection, and import pipelines into databases or spreadsheets.

How to use this file for testing

“Signed Zero Round-Trip Through Text (.csv)” is a deterministic Novus Examples fixture for Scientific data, CSV parsing, Editor testing. Citation catalogs (BibTeX, RIS), chemistry structures (MDL Molfile, PDB), and gridded binary data (NetCDF, FITS) — for testing reference managers, molecule viewers, and scientific-data loaders.

Documented properties for this file: 9 rows · 6 columns. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Scientific fixtures are small, valid, and fully synthetic — no real organism, patient, sample, or observation. Point your parser or loader at the file and check it reads the documented records, variables, or headers; binary formats ship a readable twin or metadata listing for comparison.

Code examples

import pandas as pd

df = pd.read_csv("signed-zero-in-text.csv")
print(df.head())
print(df.dtypes)

Generated by generation/scientific.py. Free for any use, no attribution required — license.