Correct if statement but code is not running(it's not as simple as it seem)

I don’t really know whats happening and how to debug this i know this question sound stupid question but please help.
So i got this code

void checkInput(string ans){

	userAnswer = ans;
	float n;
	bool checkNumber = float.TryParse(userAnswer, out n);
	Debug.Log ("rightAnswer: "+rightAnswer);
	Debug.Log ("User answer: " +n);
	bool checkzxc = n == rightAnswer;
	Debug.Log (checkzxc);
	if (checkNumber) {
		if (n == rightAnswer) {
			Debug.Log ("What?");
			input.text = " ";
			ans = " ";
			wrongAnswer.text = "";
			MoveSelectedUnitTo (saveX, saveY, savePiece);
		} else {
			Debug.Log ("rightAnswer: "+rightAnswer);
			Debug.Log ("User answer: " +n);
			wrongAnswer.text = "Wrong Answer";
		    audioTimer = GetComponent<AudioSource>();
			audioTimer.PlayOneShot (audioWrong);
		}
	}
}

`

`

But when i run this its not working even though the debug.log clearly say that they’re directly equal. Other equation works fine (0.8/0.8 and .8+.8 .8-.8 is working) i don’t know why on 0.8*0.8 i have no idea what to do.

After researching i have found out that you shouldn’t compare floats with ==. So changing my

if(n==rightAnswer) to if(Mathf.Abs(n - rightAnswer) < 0.01) fixed the problem.