Skip site navigation (1)Skip section navigation (2)
Date:      30 Jul 1999 11:26:36 +0200
From:      Dag-Erling Smorgrav <des@flood.ping.uio.no>
To:        Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
Cc:        Greg Lehey <grog@lemis.com>, chat@FreeBSD.ORG
Subject:   Re: cvs commit: src/sys/netinet ip_fw.c
Message-ID:  <xzp7lni32ur.fsf@flood.ping.uio.no>
In-Reply-To: Garrett Wollman's message of "Thu, 29 Jul 1999 23:02:07 -0400 (EDT)"
References:  <Pine.BSF.4.10.9907291008390.13541-100000@janus.syracuse.net> 	<199907291156.NAA06494@labinfo.iet.unipi.it> 	<19990730093259.A93194@freebie.lemis.com> <199907300302.XAA15392@khavrinen.lcs.mit.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Garrett Wollman <wollman@khavrinen.lcs.mit.edu> writes:
> From my ever-excrescent .plan file:
> 
> 	There is no _inherent_ virtue in symbolic names.  Pi over two is
> 	GROSSLY unlikely to change in circumstances where Pi remains constant.

So imagine you write a large program which uses Pi a lot. Imagine
further that this program is being developed by several different
people. They use literal constants instead of symoblic constants. So
the program has different literal constants for Pi scattered all over:
3.14, 3.1415, 3.14159265, 3.14159265358 (truncated) and 3.14159265359
(rounded) - and that's assuming none of them ever makes a typo.

Even if you manage to get them all to agree on one specific value
(say, 3.14159265359), what are you going to do if you decide to port
your application to a different system which has higher floating-point
precision and want to use a more precise value of pi? Search-replace
throughout the entire source tree?

DES
-- 
Dag-Erling Smorgrav - des@flood.ping.uio.no


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-chat" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xzp7lni32ur.fsf>