NOTE ADDED AFTER THE COMMENTS TO THE QUESTION
In the code you posted you're doing integer division, that sends has int as result (see also this answer).
From what I read in the comments.
target.x
, target.y
, speedx
and speedz
(and also the constant 4) are all integers.
See also this example:
int x = 13 / 4; //this returns int 3
So you need no casting there.
Answer to the question float to Vector3Int
Float does not convert to int implicitly, so your code won't compile. You need a cast for the conversion.
Consider also that the conversion truncates the float.
float x = 124.345f;
int y = (int) x; //x will become 124.
In your specific case you can convert it like this.
m_target = new Vector3Int((int) target.x-speedx/4, (int)target.y, (int)target.z-speedz/4);
And the result will be (124.0, 0.0, 0.0).
If you want to achieve other results you may check these methods.
FLOAT TO INT CONVERSIONS
Mathf.Floor and Math.FloorToInt
The end result will be just as the base cast. The float will be truncated to the lower int.
float x 124.345;
int y = (int) Mathf.Floor(x); //y will become 124
//or
int z = Mathf.FloorToInt(x); //z will become 124
CONVERSION RESULTS
float 124.345f
→ converts to int 124
float 124.789f
→ converts to int 124
Mathf.Ceil and Mathf.CeilToInt
The float will be truncated to the higher int.
float x 124.345;
int y = (int) Mathf.Ceil(x); //y will become 125
//or
int z = Mathf.CeilToInt(x); //z will become 125
CONVERSION RESULTS
float 124.345f
→ converts to int 125
float 124.789f
→ converts to int 125
Mathf.Round and Mathf.RoundToInt
The float will be rounded to the closer int.
float x 124.345;
int y = (int) Mathf.Round(x); //y will become 124
//or
int z = Mathf.RoundToInt(x); //z will become 124
CONVERSION RESULTS DIFFERS
float 124.345f
→ converts to int 124
float 124.789f
→ converts to int 125