Re: Decimal Arithmetic



James J. Weinkam wrote in message ...
>glen herrmannsfeldt wrote:
>> James J. Weinkam wrote:
>>
>> (snip)
>>
>>> I know they work as documented, and I never said they didn't. This
>>> all started when John Kennedy said that PL/I did not have an INTEGER
>>> data type. Robin said that it did. I have been trying without any
>>> success to get Robin to understand that the fact that a knowledgeable
>>> programmer can get INTEGER behavior by any of several techniques does
>>> not mean that PL/I has a true INTEGER data type.
>>
>> If you want to look at it that way, no language has a true integer
>> data type. That is, one that can hold any of the infinite number
>> of possible integer values.
>>
>> -- glen
>>
>Not at all. Certainly, the infinite set of integers as defined in Mathematics
>cannot be perfectly reproduced in computer arithmetic, but in a language that
>has a true INTEGER data type, the following is true of any INTEGER expression:
>either the evaluation of the expression causes a fault or the result is the
same
>as the theoretical result and all intermediate results are integers. This is
>not true in PL/I for all expressions involving only integers

You wouldn't want it to be. PL/I generates as accurate results as it can
for any kind of fixed-point expression, including integers.

> but only for those
>in which the programmer has taken care to avoid the inadvertent generation of
>fractional places (i.e., non integers) in intermediate results.

By defining integer variables and constants as having max precision,
integer data type is available in PL/I.


.



Relevant Pages

  • Re: Query Problems
    ... is the 2nd column in the SELECT clause. ... James wrote: ... > Count FROM tblResponses) AS ReturnPercentage ... >>>>to the appropriate data type if necessary. ...
    (microsoft.public.access.queries)
  • Re: Codding Questions/Problems
    ... > "James" wrote in message ... >> to encorporate a search facility onto a database which has ... >> select the data type the wish to look through i.e. CD then ... >> in this memo field on the form view it comes up and is set ...
    (microsoft.public.access.modulesdaovba)
  • Re: Convert an Object to an array of strings.
    ... Cast the value that you get back to the actual data type. ... If the object really is a string array, ... james wrote: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Data type to hold decimals
    ... Look at Double Data Type and Single Data Type in VBA help. ... Look for CDbl and CSgl in the VBA help page: 'Type Conversion Functions' ...
    (microsoft.public.excel.programming)
  • Todays date in Access
    ... to leave a transction log? ... I have tried putting the current date in a SQL string ... It looks OK if I change the data type in the ... James ...
    (microsoft.public.access.formscoding)