Any point on the surface of your box will have at least one coordinate equal to 0.5 or -0.5, and all the rest will be -0.5 <= c <= 0.5.
So, find the coordinate with the highest absolute value, and then draw a vector to make this coordinate equal to +/- 0.5.
Something like this might work:
if (fabs(x) > fabs(y) && fabs(x) > fabs(z))
y *= 0.5 / fabs(x)
z *= 0.5 / fabs(x)
x *= 0.5 / fabs(x)
else if (fabs(y) > fabs(z))
x *= 0.5 / fabs(y)
z *= 0.5 / fabs(y)
y *= 0.5 / fabs(y)
else
x *= 0.5 / fabs(z)
y *= 0.5 / fabs(z)
z *= 0.5 / fabs(z)