How to solve error : “Assignment or comparison loses precision”


When you assign the value to different data type, you will get this type of error message : “Assignment or comparison loses precision”

For example:
int x = 10;
real y;
y = x;

To solve this issue, we can use the functions like any2real, any2int, any2str
y = any2real(x);

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s