answersLogoWhite

0

What does possible loss of precision means?

Updated: 11/4/2022
User Avatar

Tushumodi

Lvl 1
13y ago

Best Answer

When Java (or another programming language) warns you that there is a possible loss of precision, they mean that you are trying to treat one type of number as a different type.

For instance, if you try to store an int value in a byte variable:

int i = 10;

byte b = i;

The int can store more information, so forcing it into a byte may cause a loss of that extra information.

In order to work around this, you need to cast the variable to tell the programming language that you really want to convert from one type to the other.

int i = 10;

byte b = (byte) i;

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What does possible loss of precision means?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How can you make a sentence for precision?

it means i precision you


Loss of precision error in java?

A loss of precision error occurs when you use a variable of a data type that holds more decimal values than the type of the variable you are converting/inserting to.


How do you use precision?

I don't a clue wat precision means sorry ppl


What is the purpose of normalisation?

If you are referring to normalization of floating point numbers, it is to maintain the most precision of the number possible. Leading zeros in floating point representation is lost precision, thus normalization removes the leading zeros by shifting left and adjusting the exponent. If the calculation was done in a hidden extended precision register (like IEEE 80-bit format) extra precision bits may be shifted in to the LSBs before restoring the result to a standard single or double precision register, reducing loss of precision.


What is the precision and the greatest possible error of 20400L?

The precision of integers with trailing zeros is ambiguous. The precision of 20400 litres can be 1, 10 or 100. Corresponding to these values, the greatest possible errors can be 0.5L, 5L or 50L. Actually, the precision could even be 20400L, in which case the maximum possible error is 10200L. If, for example, you had tanks of 20400L each, you might simply know how many tanks' worth you had - precision to 20400L. Unlikely, though.


What error occurs when a real value is attempted to be assigned to an integer variable?

real value neededA compile time error i.e ..Error: possible loss of precision: double, required: intNone, it will converted automagically.


How do you write 32000mL by placing a decimal to make it a reasonable answer?

32000 mL is a perfectly reasonable answer. An answer obtained by converting it to litres instead of mL may seem reasonable in terms of a shorter answer but it means a loss of precision.


What is a precision instrument?

Precision means accuracy. A precision instrument is a top quality one that is super-accurate. You can get an instrument that will just do the job, or you can spend extra money and get a precision instrument that will be perfect. Many measuring devices are precision instruments because they must be totally accurate.


What are some possible values in science?

reliability,testability,accuracy,precision,generality


Are any of the diets for weight loss under 2 months long?

I definatly believe that it is possible to lose as much weight as possible in 2 months. "As much as possible" means the commetment that you put into loosing it.


Perhaps unsurprisingly the name of what firm means precision in Japanese?

Seiko


What are the effects of canabis on the body?

1. Light-headedness.2. Heightened emotions.3. Short-term memory loss.4. Loss of precision skills.5. Paranoia.