Repository navigation
Float64Range and Float64Set (first half of #153) #196
Copy link
Copy link
Labels
area/jsonSystem.Text.Json and TypeConverter wire formsSystem.Text.Json and TypeConverter wire formsarea/literalsParse, TryParse and formattingParse, TryParse and formattingarea/rangesRange unions, variants and the shape enginesRange unions, variants and the shape enginesarea/value-setsValue set families and wrapper aritiesValue set families and wrapper aritiesenhancementNew feature or requestNew feature or requestpackage/coreAffects CodoMetis.ValueRangesAffects CodoMetis.ValueRangespackage/efcoreAffects CodoMetis.ValueRanges.EFCore.PostgreSQLAffects CodoMetis.ValueRanges.EFCore.PostgreSQL
Milestone
Description
The double half of #153, split out so it can merge on its own; Float32Range/Float32Set follow in a stacked PR that closes #153. The design is #153's, unchanged.
Measured on PostgreSQL 16 and 18 (scratch containers), held on 17 by the integration suite:
- The
[5,NaN)/[NaN,5)/[0,) @> NaN/[1,Infinity)rows of Float64Range/Float64Set and Float32Range/Float32Set over finite values only, mapped to custom float8range and float4range #153 reproduce on 16 and 18. float8outatextra_float_digits1 is Ryu built withacceptBounds = false(STRICTLY_SHORTESTundefined insrc/common/d2s.c), laid out in fixed notation for decimal exponents −4…14 and asd.ddde±xxotherwise. .NET's shortest form differs in layout for most exponent-form values and in digits for 128 of 40,016 sampled doubles (1e23→ PG9.999999999999999e+22), always reading back as the same value — except two.- .NET 10 defect:
double.ToString()/"R"(and System.Text.Json's writer) print 2^-25 as2.980232238769531E-08and 2^-958 as4.104536801298376E-289, which read back one ulp lower. Exhaustive over the neighbourhood of every power of two and 0 of 20M random doubles otherwise; nofloatfailures sampled. - A PG-exact formatter (
Internals/FloatLiteral.cs) matchesfloat8outon 649,929 doubles on 16 and 18, 0 mismatches. CREATE TYPE … (subtype = float8, subtype_diff = float8mi): inserting or indexing extreme values under GiST fails with22003 value out of range: overflowon 16 and 18; without the diff the index builds and answers.float8inaccepts Cstrtodhexadecimal (0x10) on musl; the family refuses it (andNaN/inf/out-of-range text, wheredouble.Parsesilently returns infinity or zero).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/jsonSystem.Text.Json and TypeConverter wire formsSystem.Text.Json and TypeConverter wire formsarea/literalsParse, TryParse and formattingParse, TryParse and formattingarea/rangesRange unions, variants and the shape enginesRange unions, variants and the shape enginesarea/value-setsValue set families and wrapper aritiesValue set families and wrapper aritiesenhancementNew feature or requestNew feature or requestpackage/coreAffects CodoMetis.ValueRangesAffects CodoMetis.ValueRangespackage/efcoreAffects CodoMetis.ValueRanges.EFCore.PostgreSQLAffects CodoMetis.ValueRanges.EFCore.PostgreSQL
Activity