sqrt(2) must go

Russel Winder russel at russel.org.uk
Wed Oct 19 23:02:23 PDT 2011


On Wed, 2011-10-19 at 23:36 -0400, dsimcha wrote:
> On 10/19/2011 11:27 PM, Marco Leise wrote:
> > And real can be used without protability problems on PowerPC or ARM?
> 
> Yes, it's just that they may only give 64 bits of precision.  Floating 
> point is inexact anyhow, though.  IMHO the fact that you may lose a 
> little precision with very large longs is not a game changer.

This is not convincing.

One of the biggest problem is software development is that computers
have two systems of hardware arithmetic that are mutually incompatible
and have very different properties.  Humans are taught that there are
abstract numbers that can be put into different sets:  reals, integers,
naturals, etc.

There are already far too many programmers out there who do not
understand that computer numbers have representation problems and
rounding errors.

Another issue:

	sqrt ( 2 )
	sqrt ( 2.0 )
	sqrt ( 2.0000000000000000000000000000000000000000 )

actually mean very different things.  The number of zeros carries
information.

Summary, losing precision is a game changer.  This stuff matters.  This
is a hard problem.

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at russel.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20111020/b2a54ebb/attachment-0001.pgp>


More information about the Digitalmars-d mailing list