Question: So:

```
//aValue = 4.45
//bValue = 4.35
//maxValueDiff = 0.1
//The absolute value of a - b = 0.1

if( Math.abs(aValue - bValue) <= maxValueDiff ) return true;
logger.info("valueDiffCheck a:" + aValue +" b:"+ bValue + " e1:" + maxValueDiff);

```

Why do I see this in my logs:

```
valueDiffCheck a:4.45 b:4.35 e1:0.1

```

Suspect this is because Double is a double pain with it's inaccuracies but if that were the case shouldn't I **see** that? Like it should print that 0.1 is actually 0.10000000111 or something? ...or is there something pesky about the printing format?

The target code is high performance with a LOT of data so we don't want to use BigDecimal. What's the next best thing to ensure that 0.44 is 0.44? 

OK let me state unequivocally that we only need two decimal places. The accuracy involved in using BigDecimal is major overkill.

Answer: 
I solve this problem by using an error margin in places where it might come up. The following is a very simple way - but not necessarily the best way (you may want it more centralized, configurable, etc.) - to modify your code to do this:

```
private static final double ERROR = 1e-7;

// SNIP

if( Math.abs(aValue - bValue) <= maxValueDiff + ERROR) return true;
logger.info("valueDiffCheck a:" + aValue +" b:"+ bValue + " e1:" + maxValueDiff);

```
You can always consider using your own decimal class that uses `long` to store the value and a decimal placeholder.

```
public Class MyDecimal
{
    private long value = 0;
    private long decimalPlace = 0;

    ...
}

```

This means you can make 0.44 be doing something like:

```
MyDecimal decimal = new MyDecimal(44, 2);

```

As mentioned in the other answer though, `BigDecimal` will be your best bet to ensure accuracy.