Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Ansi -iso > What is the "sa...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 134 of 215
Post > Topic >>

What is the "same value" (Extended Pascal)

by Frank Heckenbach <frank@[EMAIL PROTECTED] > Feb 5, 2005 at 03:13 PM

: When an identifier or label has a defining­point for a region,
: another identifier or label with the same spelling shall not have
: a defining­point for that region unless both identifiers are
: im****ted identifiers and denote the same value, variable,
: procedure, function, schema, or type.

Question: What is the "same value"?

Does it mean values for which `=' would be true (at least for types
that `=' is defined on), e.g. in the following code, do a and b
denote the same value?

const
  a = 2;
  b = 1 + 1;

This gets tricky for real numbers, as arithmetics are
implementation­defined approximations. This is related to the
question whether (given a compiler) the arithmetics done at
compile-time must be equivalent to those done at run-time, or
whether they could, e.g., use higher precision. E.g., in the
following code, can and/or must c and d denote the same value?

const
  c = 1.0;
  d = Sin (0.4) * Sin (0.4) + Cos (0.4) * Cos (0.4);

Or does the "same value" only mean such values that come from the
same definition? In this case, both examples above would not denote
the same value, but e and f would:

ex****t Foo = (e, e => f);

const
  e = 42;

And what about simple constant definition equalities, such as:

const
  g = Sin (0.4) * Sin (0.4) + Cos (0.4) * Cos (0.4);
  h = g;

Any pointers to relevant parts of the standard are appreciated.

Frank

-- 
Frank Heckenbach, frank@[EMAIL PROTECTED]
 http://fjf.gnu.de/
GnuPG and PGP keys:         http://fjf.gnu.de/plan
(7977168E)
Pascal code, BP CRT bugfix: http://fjf.gnu.de/programs.html
Free GNU Pascal Compiler:   http://www.gnu-pascal.de/
 




 4 Posts in Topic:
What is the "same value" (Extended Pascal)
Frank Heckenbach <fran  2005-02-05 15:13:18 
Re: What is the "same value" (Extended Pascal)
John Reagan <john.reag  2005-02-07 15:35:08 
Re: What is the "same value" (Extended Pascal)
Frank Heckenbach <fran  2005-02-09 14:34:29 
Re: What is the "same value" (Extended Pascal)
John Reagan <john.reag  2005-02-11 13:09:00 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 18:16:17 CDT 2008.