question about transform.position

Hello!
The question of course silly, but. There are “Game Obetst” moves horizontally.
Prescribe him a script, for example:

void Update () {               
if (transform.position.x == 1) 
{
 Debug.Log ("test");
}

The script must be in the debug output “test”. But “Game Object” overshoots this coordinate.
Character runs horizontally when it reaches a certain position, it is necessary to perform an action. How to achieve this?

void Update () {
if (transform.position.x >1.0f)
{
Debug.Log (“test”);
}
}

void Update () {
if (transform.position.x >= 0.8f && transform.position.x <= 1.2f)
{
Debug.Log (“test”);
}

So? And that’s OK? -)