It is from the family of serviceberries which has various names, e.g. "wildplume", but I cannot decide between two species. In any case they seem to be eatable raw and cooked, but I have not tried it myself.
I am inclined that it may be Amelanchier ovalis:
Its pome fruits are edible and can be eaten raw or cooked.
It also may be Amelanchier ...
We don't know what you actually saw, but cranberries don't grow either floating on water, or under water.
The plants grow in a bog, and are vines up to 6 feet long.
They are often harvested by flooding the bog and stirring the water with machinery, which makes the ripe berries break off the vines and float. They can then be collected mechanically. For making ...
I believe that they actually grow in soil (well, a bog really, so soil, water, peat, clay) and the fruits are connected to a vine. The berries are buoyant, so they float on the water, connected to the vine. The waterborn nature of the berry then makes it easier to harvest.