Closest-pair problem: Difference between revisions

Content added Content deleted
No edit summary
m (BASIC 256 and BBC BASIC moved to the BASIC section.)
Line 392: Line 392:
distance between (0.891663,0.888594) and (0.925092,0.818220) is 0.0779102
distance between (0.891663,0.888594) and (0.925092,0.818220) is 0.0779102
</pre>
</pre>

=={{header|BASIC256}}==
=={{header|BASIC}}==
==={{header|BASIC256}}===
'''Versión de fuerza bruta:
'''Versión de fuerza bruta:
<syntaxhighlight lang="basic256">
<syntaxhighlight lang="basic256">
Line 414: Line 416:
El par más cercano es 2 y 5 a una distancia de 0,077910191355
El par más cercano es 2 y 5 a una distancia de 0,077910191355
</pre>
</pre>

=={{header|BBC BASIC}}==
==={{header|BBC BASIC}}===
To find the closest pair it is sufficient to compare the squared-distances,
To find the closest pair it is sufficient to compare the squared-distances,
it is not necessary to perform the square root for each pair!
it is not necessary to perform the square root for each pair!