Why is Input.GetAxisRaw() not returning whole numbers when using a joystick?

So I need to only receive -1, 0, or 1 as values from the Joystick (using a wired 360 controller at the time). When I use the following code with a keyboard it works exactly as intended, but when I use the thumbstick on the gamepad I get odd movement behaviors. When I tried adding Debug.Log(Input.GetAxisRaw(“Vertical”); the console showed it returning values between -0.2 and 0.2. I have no idea what is causing this and while I can think of a way around it it’ll take quite a bit of hard coding I’d rather avoid if at all possible.

    float previousAxisStateX;
	float previousAxisStateY;
	float tileSizeX = 2f;
	float tileSizeY = 1f;
	Vector3 transPos;

	void Update()
	{
		if (Mathf.Abs(Input.GetAxis("Horizontal")) > Mathf.Abs(Input.GetAxis("Vertical")))
		{
			if (previousAxisStateX == 0)
			{
				transPos = new Vector3(transform.position.x + (tileSizeX * Input.GetAxisRaw("Horizontal")),transform.position.y,transform.position.z);
				transform.position = transPos;
			}
		}
		else
		{
			if (previousAxisStateY == 0)
			{
				transPos = new Vector3(transform.position.x, transform.position.y + (tileSizeY * Input.GetAxisRaw("Vertical")),transform.position.z);
				transform.position = transPos;
			}
		}
		previousAxisStateX = Input.GetAxis("Horizontal");
		previousAxisStateY = Input.GetAxis("Vertical");
	}

I was misunderstanding how Input.GetAxisRaw() works. Its doesn’t only return whole numbers it merely removes smoothing so an analog stick that can be held at anywhere between -1 and 1 would return values as such. In then end I changed my code to

float previousAxisStateX;
float previousAxisStateY;
float tileSizeX = 2f;
float tileSizeY = 1f;
Vector3 transPos;



void Update()
{
	if (Mathf.Abs(Input.GetAxis("Horizontal")) > Mathf.Abs(Input.GetAxis("Vertical")))
	{
		if (previousAxisStateX == 0)
		{
			int axis = 0;
			if (Input.GetAxis("Horizontal") > 0)
				axis = 1;
			if (Input.GetAxis("Horizontal") < 0)
				axis = -1;
			transPos = new Vector3(transform.position.x + (tileSizeX * axis),transform.position.y,transform.position.z);
			transform.position = transPos;
		}
	}
	else
	{
			if (previousAxisStateY == 0)
		{
			int axis = 0;
			if (Input.GetAxis("Vertical") > 0)
				axis = 1;
			if (Input.GetAxis("Vertical") < 0)
				axis = -1;
			transPos = new Vector3(transform.position.x, transform.position.y + (tileSizeY * axis),transform.position.z);
			transform.position = transPos;
		}
	}
	previousAxisStateX = Input.GetAxis("Horizontal");
	previousAxisStateY = Input.GetAxis("Vertical");

	
}