How do i make a float match to another float on other script

im having some trouble anyone help me i declare a float in script1 and declare another float in script2 and im trying to make it when a number is equal it has a function like this one but im having trouble

//script1



public class script1 : MonoBehaviour{


public float A;
public script2 s2;

void Update(){

if (A == s2.B)
{
print("True");
}
else
{
print("False");
}


}

}

script2 :

//script2


public class script2: MonoBehaviour{
 
 
 public float B;

 
}

any help please

public class script2: MonoBehaviour{

  public float B;
  public GameObject tempObject;
  public script1 tempScript;


  void Start()
  {
  tempScript = tempObject.GetComponent<script1>(); //this is assuming that you have dragged a gameObject with script1 attached to it in the inspector.
  B = tempScript.A;
  }
  
 }