float64 to float32 Precision Loss — Paired Array (.npy)
The precision-loss cases as a two-column float64 array holding the original value beside its float32 round trip, both kept at double width so the difference itself is representable. Subtracting the columns gives the error directly without a second narrowing step.
| Original | After float32 round trip | Survived? |
|---|---|---|
| 0.1 | 0.10000000149011612 | no |
| 0.3333333333333333 | 0.3333333432674408 | no |
| 3.141592653589793 | 3.1415927410125732 | no |
| 16777217.0 | 16777216.0 | no |
| 123456789.12345679 | 123456792.0 | no |
| 1e-40 | 9.99994610111476e-41 | no |
Specifications
- Dtype
- float64
- Shape
- 12 x 2
- Column0
- the original double
- Column1
- the value after a float32 round trip
- Contains Infinity
- true
- Contains Subnormal
- true
Testing contract
Reference control- Scenario
- Load the array and subtract column 1 from column 0 to obtain the narrowing error for every case.
- Expected result
- The array is (12, 2) float64, the difference is exactly zero for the values that survive narrowing, and the 1e39 row yields -Inf because its round trip overflowed.
What is a .npy file?
NPY is NumPy's native binary format for a single array. A short header records the dtype, shape, and memory order, followed by the raw array bytes, so an array round-trips exactly without any text parsing. It is the standard way to persist embeddings, tensors, and numeric matrices in the Python data stack.
How to use this file
Use an example .npy to test array loaders (numpy.load), tensor and embedding pipelines, and converters between .npy, JSON, and columnar formats like Parquet.
How to use this file for testing
“float64 to float32 Precision Loss — Paired Array (.npy)” is a deterministic Novus Examples fixture for Scientific data, Error handling. 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: NPY · 320 bytes. 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.
Related files
- npyfloat64 Subnormal Ladder — Gradual Underflow (.npy)A ten-step ladder from the smallest representable double up across the subnormal boundary into normal range, showing precision degrading to a single significant bit. Any pipeline running with flush-to-zero enabled turns the first eight entries into plain zeros without reporting anything.

- npyIEEE-754 float32 Boundary Values (.npy)The single-precision counterpart of the float64 boundary array, including the 2^24 integer limit where consecutive whole numbers stop being representable. Widening float32 to float64 and back must preserve every one of these bit patterns.

- jsonIEEE-754 float64 Boundary Values — JSON With No NaN Literal (.json)The same boundary values as strict RFC 8259 JSON, where non-finite numbers are null in the numeric field and text in the string field because the standard has no NaN or Infinity literal. It is the fixture for the encoder that emits bare NaN and produces JSON nothing else will parse.

- npyIEEE-754 float64 Boundary Values (.npy)The sixteen structurally distinct float64 values a numeric pipeline has to survive, in binary form: both zeros, both subnormal limits, the smallest normal, epsilon, the largest finite value, both infinities, a quiet NaN and the 2^53 integer boundary. Round-tripping this array is the minimum bar for any float64 codec.

- npyNaN Payloads and Signalling NaNs (.npy)Six distinct NaN bit patterns — quiet, signalling, signed and payload-carrying — stored as float64. They are all NaN and none equals another, so any code that deduplicates, sorts or hashes them by value is doing something undefined and this array proves it.

- binRaw float64 Block — Big-Endian, No Header (.bin)The same sixteen doubles written in network byte order, so every eight-byte group is the mirror of the little-endian twin. Decoding it with the wrong assumption produces small plausible-looking numbers rather than an error, which is why this pair exists.

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