Question: I need to write a small Java program that deals with calculations involving money. Therefore it needs to have accuracy. (Eg: No `float`/`double` variables, only `long`).

Unfortunately, the original value I need to use is imported through a method which can only read variables as "double".

Now, I tried casting it to a `long` using a method similar to:

```
double importedValue = x;
double importedValueConverted = (long) x;

```

However, when I try dividing importedValueConverted by another "long" variable I get:

> 
> required: long 
>  found: double 
>  error: possible loss of precision
> 
> 
> 

Why is that?

Answer: 
```
double importedValue = x;
double importedValueConverted = (long) x;

```

Note that both of these variables are declared as 'double'. This results in your error (paraphrasing): (the operation you're doing requires a) `long` (but when it tried it found a) `double`.

You want:

```
double importedValue = x;
long importedValueConverted = (long) x;

```
If you wanna cast double to long you do below.

```
    double importedValue = 8.0;
    long importedValueConverted = (long) 8.0;
    System.out.println(importedValueConverted/(long)8);

```

OUTPUT: 1

```
double importedValue = x;
double importedValueConverted = (long) x;

```

you were trying to cast a double to long and reassign the casted value to a double. you should assign it to long.