Skip to content

Commit

Permalink
HSEARCH-3487 Add TODOs related to Elasticsearch imprecision problem f…
Browse files Browse the repository at this point in the history
…or scaled_float
  • Loading branch information
yrodiere authored and fax4ever committed May 23, 2019
1 parent 228a8fc commit 3469a5e
Showing 1 changed file with 2 additions and 0 deletions.
Expand Up @@ -107,9 +107,11 @@ private BigDecimal scaled(long longValue) {

// Transform to a double to make it consistent with ES behaviour
// Lucene backend would not need that
// TODO HSEARCH-3583 Fix the precision issue in Elasticsearch and remove this hack
BigDecimal bigDecimal = BigDecimal.valueOf( decimal.doubleValue() );

// for double imprecision we risk to cross the bounds
// TODO HSEARCH-3583 Fix the precision issue in Elasticsearch and remove this hack
return ( longValue > 0 ) ?
bigDecimal.subtract( BigDecimal.TEN ) :
bigDecimal.add( BigDecimal.TEN );
Expand Down

0 comments on commit 3469a5e

Please sign in to comment.