M=h′h=−vu where h' is the image height, h is the object height, v is the image distance and u is the object distance. When the magnification becomes negative it means that the image formed is real and when the image formed is virtual, then the magnification is positive. Here M is the magnification, v is the image distance and u is the object distance.
We found a similar question to the one that you posted. Please check it out
here.
Try this on magnifications.