Volume of cubes and rectangular prisms with fractional side lengths