Skip to content

Conversation

@jpountz
Copy link
Contributor

@jpountz jpountz commented Dec 14, 2016

Our float/double fields generally assume that -0 compares less than +0,
except when bounds are exclusive: an exclusive lower bound on -0 excludes
+0 and an exclusive upper bound on +0 excludes -0.

Closes #22167

Our `float`/`double` fields generally assume that `-0` compares less than `+0`,
except when bounds are exclusive: an exclusive lower bound on `-0` excludes
`+0` and an exclusive upper bound on `+0` excludes `-0`.

Closes elastic#22167
@jpountz jpountz added :Search/Search Search-related issues that do not fall into other categories >bug v5.1.2 v5.2.0 v6.0.0-alpha1 labels Dec 14, 2016
assertEquals(
NumberType.HALF_FLOAT.rangeQuery("field", null, -0f, true, true),
NumberType.HALF_FLOAT.rangeQuery("field", null, +0f, true, false));

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should also test nextUp(-0f) ?:

assertEquals(
            NumberFieldMapper.NumberType.DOUBLE.rangeQuery("field", -0f, null, false, false),
            NumberFieldMapper.NumberType.DOUBLE.rangeQuery("field", +0f, null, true, false));

Copy link
Contributor

@jimczi jimczi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left comment regarding the tests
LGTM otherwise

@jpountz jpountz merged commit 84edf36 into elastic:master Dec 21, 2016
@jpountz jpountz deleted the fix/negative_zero branch December 21, 2016 15:51
jpountz added a commit that referenced this pull request Dec 21, 2016
Our `float`/`double` fields generally assume that `-0` compares less than `+0`,
except when bounds are exclusive: an exclusive lower bound on `-0` excludes
`+0` and an exclusive upper bound on `+0` excludes `-0`.

Closes #22167
jpountz added a commit that referenced this pull request Dec 21, 2016
Our `float`/`double` fields generally assume that `-0` compares less than `+0`,
except when bounds are exclusive: an exclusive lower bound on `-0` excludes
`+0` and an exclusive upper bound on `+0` excludes `-0`.

Closes #22167
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Dec 22, 2016
* master: (22 commits)
  Support negative numbers in writeVLong (elastic#22314)
  UnicastZenPing's PingingRound should prevent opening connections after being closed
  Add task to clean idea build directory. Make cleanIdea task invoke it.
  add trace logging to UnicastZenPingTests.testResolveReuseExistingNodeConnections
  Adds ingest processor headers to exception for unknown processor. (elastic#22315)
  Remove much ceremony from parsing client yaml test suites (elastic#22311)
  Support numeric bounds with decimal parts for long/integer/short/byte datatypes (elastic#21972)
  inner hits: Don't inline inner hits if the query the inner hits is inlined into can't resolve mappings and ignore_unmapped has been set to true
  Fix stackoverflow error on InternalNumericMetricAggregation
  Date detection should not rely on a hardcoded set of characters. (elastic#22171)
  `value_type` is useful regardless of scripting. (elastic#22160)
  Improve concurrency of ShardCoreKeyMap. (elastic#22316)
  fixed jdocs and removed already fixed norelease
  Adds abstract test classes for serialisation (elastic#22281)
  Introduce translog no-op
  Provide helpful error message if a plugin exists
  Clear static variable after suite
  Repeated language analyzers (elastic#22240)
  Restore deprecation warning for invalid match_mapping_type values (elastic#22304)
  Make `-0` compare less than `+0` consistently. (elastic#22173)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :Search/Search Search-related issues that do not fall into other categories v5.1.2 v5.2.0 v6.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants