Re: Fixed-Point and Scientific Notation



On Sun, 27 Apr 2008 14:37:10 -0400 "John P. Baker" <jbaker314@xxxxxxxxxxxxx>
wrote:

:>In many cases, the user may simply specify 1.75E+6, the context will
:>determine both the format and the length, and everything will be fine.

:>However, there are other computational situations where the use of a
:>particular format and/or length is important, and the choice of an incorrect
:>format and/or length may result in miniscule computational errors, which
:>then grow into significant errors through a subsequent series of
:>computations.

In which cases would it not be resolvable via context?

:>It is therefore necessary that the capability to specify formats and lengths
:>be present.

:>I am currently considering suffix characters of "B" (binary), "D" (decimal),
:>and "H" (hexadecimal).

:>However, I need to come up with a scheme for the specification of length.
:>"S" (single) and "Q" (quad) would seem to work, but "D" (double) would
:>already be in use as "D" (decimal).

I would suggest that if the format cannot be determined by context, that the
raw data as specified be retained with a flag indicating the situation. Then
when finally used it can be properly handled.

Such as

FIELD1 = 1.23

Without knowing what "FIELD1" is, the data cannot be properly stored to be
used as is. But it can be retained as a scaled fixed field (which would be
exact) and then when used in a floating point expression be properly converted
to the correct form.

But, all in all, it ain't my dog.

:>-----Original Message-----
:>From: IBM Mainframe Discussion List [mailto:IBM-MAIN@xxxxxxxxxxx] On Behalf
:>Of Binyamin Dissen
:>Sent: Sunday, April 27, 2008 2:20 PM
:>To: IBM-MAIN@xxxxxxxxxxx
:>Subject: Re: Fixed-Point and Scientific Notation
:>
:>If I recall correctly, FORTRAN/PLI needed explicit exponentiation, i.e.,
:>
:> DOUBLE A,B
:> .
:> A = B+1.23
:>
:>would use a short 1.23 rather than determining that the other operands were
:>double thus 1.23 should be treated as a double as well.
:>
:>One had to do
:>
:> A = B+1.23D0
:>
:>It would behoove you to determine the context to generate the best values.
:>
:>If your parser will support scaled values, 1.23 may not even be a floating
:>point number - it may be a fixed scaled value.
:>
:>In general it is best to make things easier for the carbon life forms
:>creating
:>and using the data rather than the silicon non-life forms processing the
:>data
:>(even if it does cause more initial work for the carbon life forms
:>programming
:>the silicon).

--
Binyamin Dissen <bdissen@xxxxxxxxxxxxxxxxxx>
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel


Should you use the mailblocks package and expect a response from me,
you should preauthorize the dissensoftware.com domain.

I very rarely bother responding to challenge/response systems,
especially those from irresponsible companies.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to listserv@xxxxxxxxxxx with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

.



Relevant Pages

  • Re: Fixed-Point and Scientific Notation
    ... determine both the format and the length, ... It is therefore necessary that the capability to specify formats and lengths ... It would behoove you to determine the context to generate the best values. ... and using the data rather than the silicon non-life forms processing the ...
    (bit.listserv.ibm-main)
  • Re: Need performance help
    ... Monitor utility output to Comma Separated Value format files. ... At least one CSV file must be specified. ... the matching parameters from all the files are shown on the same chart. ... specify the commands on the command line. ...
    (comp.os.vms)
  • Re: "static" prefix - to parallel "this" prefix
    ... What does that have to do with the topic of using the classname to ... > It has to do with this - which was the context until this message, ... if you *had* to specify the classname for ... The keyword you're proposing ...
    (comp.lang.java.programmer)
  • Re: Frustrating COM+/Remoting Service Issue
    ... Interop dlls are in the GAC. ... > Activation Context: Don't force..., Must be activated in the default ... > void Method(e1 type, string def, e2 format, out byteresults); ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: "static" prefix - to parallel "this" prefix
    ... The only alternative is not to use constructors ... specify context? ... *all*....provided you give your static field or method a name *different ...
    (comp.lang.java.programmer)