Is RaycastHit an expensive operation vs something via JS?

For a game whose elements basically snap to discrete grids, I'm wondering if it would be overkill to use RaycastHit to figure out which grid square we are currently on. These grid squares would all be even 10x10's, and all elements are 10x10 square, so you can basically know the grid square to snap to by referencing the element's center.

RaycastHit is a Unity native function, so I wonder if it would be more efficient to use that instead of this JS approx. If not, then when would you want to use RaycastHit over a simple position calculation?

A raycast is going to be much more expensive than simply rounding off a couple of numbers.