when *read-base* is something like 16, some numbers are of ambiguous type.
For example, 0E0 could be read as an integer 224, or as the single-float 0.0
What I want to know is, which type SHOULD take precedence in such a case?
--
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
! Richard Levitte, System manager ! tel: int+46-8-790 64 23 !
! Royal Institute of Technology ! fax: int+46-8-791 76 54 !
! Department of Telecommunication Theory ! Internet: ·······@ttt.kth.se !
! S-100 44 Stockholm, Sweden ! !
!-----------------------------------------------------------------------------!
In article <·····················@CLYDE.ttt.kth.se> ·······@ttt.kth.se writes:
>when *read-base* is something like 16, some numbers are of ambiguous type.
>
>For example, 0E0 could be read as an integer 224, or as the single-float 0.0
>
>What I want to know is, which type SHOULD take precedence in such a case?
From p.520 of CLtL2:
The ambiguity is resolved in accordance with the general principle that
interpretation as a digit is preferred to interpretation as a number
marker. The consequence in this case is that if a token can be
interpreted as either an integer or a floating-point number, then it is
taken to be an integer.
You can resolve the ambiguity by adding a decimal point. 0.E0 is always a
float.
--
Barry Margolin
System Manager, Thinking Machines Corp.
······@think.com {uunet,harvard}!think!barmar