[MLton-devel] cvs commit: Real and IEEEReal improvements

Matthew Fluet fluet@cs.cornell.edu
Mon, 2 Jun 2003 14:50:37 -0400 (EDT)


>   1. In MLton Real.scan stops after "inf" since scan is looking for a
>   prefix.  There is no need to ever look for "infinity".

But shouldn't scan accept the longest prefix that matches the regexp for a
real number?  Then it should take the whole word.

>   2. What should Real.scan do for 1.2E345?  It could scan a valid real,
>   1.2E34 from a prefix of the string, or it could scan as posInf.  I
>   guess it is required to look at the longest prefix, and so should get
>   posInf.

I think it should return posInf.  That would be consistent with scanning
the longest prefix that matches the regexp and "Values of too large a
magnitude are represented as infinities".

>   3. For Real.fmt GEN, are reals required to have at least one digit
>   after the decimal point?  MLton says no.

What's the rationale for no digit's after the decimal point?  We seem to
be different from all the other implementations in this respect.

>   4. For Real.fmt, are exponents required to be at least two digits?
>   The documentation reads as if there are exactly two, but that can't be
>   right, since reals can be larger than 9E99.  I've noticed that
>   implementations differ on whether to add a leading 0 on exponents.  I
>   decided in MLton to never add it.

Another interpretation of the spec is that Real.fmt SCI specifies the
number of digits to appear after the decimal point not, independent of the
number of digits appearing in the exponent.  (I don't think you would read
the spec as requiring Real.fmt FIX to have 3 digits appearing before the
decimal point.)  I agree that the exponent shouldn't have leading 0s.



-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel