Ray Box intersection

Thanks a lot for the reply, that function seems closer to what I was looking for.
However I ended up with an own implementation, since in the case the starting point is “inside” the bounding box surface, I want the algorithm to look for the distance to the next intersection.