INTEGER to LONGREAL 
Author Message
 INTEGER to LONGREAL

Quote:

> In TopSpeed it would be something like this:
>       i: INTEGER;
>       x: LONGREAL;
>       ....
>       x:= VAL(LONGREAL, i);

  I would hope this doesn't work, since VAL() is meaningless for LONGREALs.
And ISO M-2 may do away with LONGREALs anyway.

--------------------------------------------------------------------------------

Concert Concessions Corporation,      a division of       Winterland Productions



Sun, 04 Apr 1993 13:02:47 GMT  
 INTEGER to LONGREAL
On Wed, 17 Oct 90 05:02:47 GMT Robert L Barton said:

Quote:
>>       x:= VAL(LONGREAL, i);

>  I would hope this doesn't work, since VAL() is meaningless for LONGREALs.
>And ISO M-2 may do away with LONGREALs anyway.

>-----------------------------------------------------------------------

Well sorry to rain on your parade, but in TopSpeed that is exactly how
it works.  As to standards, well sometimes what works is more useful
than what is standard.  I found no reference to LONGREALs in N Wirth's
3th ed of PIM2 and I don't know much about the ISO M2 work (cept it's
not finished).  If it were up to me I would do things differently,
but it's not.... (I really don't care for all that type casting and
explict conversion, wish someone would expand "the standard" (what
ever it is) to include operator overloading then I overload '+'
to add int's to card's or card's to real's or ... apples to oranges
<grin>)

Greg



Mon, 05 Apr 1993 03:37:44 GMT  
 INTEGER to LONGREAL

Quote:

>>>       x:= VAL(LONGREAL, i);

>>  I would hope this doesn't work, since VAL() is meaningless for LONGREALs.
>>And ISO M-2 may do away with LONGREALs anyway.

> Well sorry to rain on your parade, but in TopSpeed that is exactly how
> it works.  As to standards, well sometimes what works is more useful
> than what is standard.  I found no reference to LONGREALs in N Wirth's
> 3th ed of PIM2 and I don't know much about the ISO M2 work (cept it's
> [Deleted]

Hit 'im again!
As far as I can gather from the third working draft m2 standard (a year old
I admit, but the most recent I have) VAL _should_ work on LONGREALs as it was
suggested.

True, "should" <> "does" and in the meantime we all have to live with the
current rash of products (and possibly forever....?), but is anyone else at
least attempting to write std code?  There are three or four of us down here
in the pit at the bottom of the world producing a lot of code looking like:

(*************** Mk 1 Compiler FUDGE *****************>>
          Blah := CAST(CARDINAL, MyProcessId);
<<******************** End of FUDGE *******************)
          Blah := CARDINAL(MyProcessId);

..in anticipation of the great day when "grep" can be brought to bear on
the word "FUDGE" and all humankind's sins are washed away....... urrrrk!

No?  Just us?

NB: Idea, format and insistance all (as far as I know) originated with
    Keith Hopper.

+bcs, U of Waikato, NZ --------------------------------------------------+
|  "Now if only I could get Comp. Serv. to give me a sane username..."   |
|      All opinions expressed are, of course, solely my own errors.      |



Fri, 09 Apr 1993 10:51:29 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Using REAL/INTEGER or LONGREAL/LONGINT

2. Re (2): Using REAL/INTEGER or LONGREAL/LONGINT

3. integer to longreal

4. "D" in LONGREAL Constants

5. LONGREAL to string

6. Converting LONGREAL to string

7. LONGREAL Accuracy

8. LONGREAL constants

9. Near Final PEP 237 - Unifying Long Integers and Integers

10. Revised PEP 237 - Unifying Long Integers and Integers

11. integer/integer division

12. Q: How to typecast integer to array of integers

 

 
Powered by phpBB® Forum Software