The UK left the European Union because of a public referendum where 51.8% of the votes were in favour in leaving the EU.
Suppose it had resulted in an tie, i.e. 50% in favour of leaving the EU, 50% against leaving the EU.
What legal framework existed at the time for handling such a tie? Would the government have been required to run the referendum a second time? Would they have settled it with a coin flip? Or was there no law about this possibility at all?