Re: HIGH Decimal ?



robin wrote:
"James J. Weinkam" <jjw@xxxxxxxxx> wrote in message news:DPCMj.26279$KP5.24294@xxxxxxxxxxx
robin wrote:
"James J. Weinkam" <jjw@xxxxxxxxx> wrote in message news:n1sMj.9963$682.9422@xxxxxxxxxxx

The OP didn't say why he wanted these values, but a common reason for
wanting the algebraically largest or smallest possible value is to
initialize a minimization or maximization algorithm.
MIN is available for that, as is MAX.
Perhaps I did not make myself clear.

Consider a possibly empty list of values. We wish to find mn and mx, the
smallest and largest values in the list respectively. What should mn amd
mx be initialized to so that we can examine each element in turn and
come up with the correct answer? The answer is that mn should be
initialized to the largest representable value and mx to the smallest.

If there are no elements in the list, it is sufficent that mx = mn-1.
In the general case, MAX and MIN are sufficient.

But if there are no elements in the list, any value is irrelevant.

There is no need to know what are the largest possible value and most negative
value. They are irrelevant.


Please yourself. However there are sound mathematical reasons for doing as I outlined.

For the operations addition and multiplication most people are familiar with the application of the operations to sequences of values using summation (sigma) or product (pi) notation. PL/I provides the SUM and PROD builtin functions for these two cases and also ANY and ALL that apply the notion to or (|) and and (&).

This idea can be generalized to any binary operation %:DxD->D, where D is some domain. This concept is most easily expressed using APL notation. If v is a vector of numbers +/v is their sum;{times}/v is their product, where {times} stands for the APL symbol for multiplication which is a cross and is not readily displayed in news group messages in a manner that everyone can read; and in general, %/v is equivalent to v[1]%v[2]%...%v[n]. These are called plus reduction, times reduction, or in general % reduction.

If u and v are two vectors, u,v is their concatenation. Ideally one would like ((%/u)%%/v)=%/u,v to hold in all cases including those where u and/or v is the empty vector, e. This only holds in general if % is associative and %e is defined to be a two sided identity for %. This means that if % is {max} or {min} %/e should be smallest representable value or largest representable value respectively.

In APL, as well as in other languages that support this concept in a general fashion, +/e and {or}/e are 0, {times}/e and {and}/e are 1, and ,/e is e. On the other hand, {nand}/e gives a DOMAIN error since nand has no identity and the relationship stated above does not hold in general even for non empty boolean vectors since nand is not associative.
.



Relevant Pages

  • Re: CString
    ... My customers don't give a hoot in hell who forgot to initialize a variable --- if the software comes from me, ... Empty(), or set the string explicitly, always, before assuming anything. ... IMO, if you dont need a function call, dont call it. ...
    (microsoft.public.vc.mfc)
  • Re: Beginners question: assigning same value to many variables
    ... Subject: Beginner's question: assigning same value to ... I presume you want each variable initialized to a _different_ empty ... string. ... it's not too hard to initialize a group of instance variables to ...
    (comp.lang.ruby)
  • Re: [crash, bisected] Re: [PATCH 3/4] x86_64: Fold pda into per cpu area
    ... To initialize the percpu data you do want to talk to the virtual address ... It might be worth saying something like. ... symbols out of empty sections and making them absolute. ...
    (Linux-Kernel)
  • Re: register_globals on / off - I think Im missing the point
    ... script are initialized early on in the script (even the empty ones). ... don't initialize $foo until you've made sure $_POSTis empty. ...
    (comp.lang.php)
  • Re: Problems compiling simple C++ code (also problems with std::string)
    ... I wanted to initialize it to NULL so I could check later, ... > using C pointer parlance here) - How do I check that variable name ... > has been initialized or is not empty? ... > the constructor shown above, the compiler somehow, does not recognize ...
    (microsoft.public.vc.language)