[MLton-devel] cvs commit: Real and IEEEReal improvements
Matthew Fluet
fluet@cs.cornell.edu
Mon, 2 Jun 2003 16:11:33 -0400 (EDT)
> > > 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.
>
> I am confused. Are you saying agree that SCI specifies the number of
> digits after the decimal point including the exponent (your "not" is
> confusing me)? I.E.
> fmt (SCI (SOME 3)) 1.2 = "1.20E0"
> No that can't be what you mean. I'm confused.
Sorry, bad editting on my part. I meant to say that you could interpret
Real.fmt SCI as specifying the number of digits that appears between the
decimal point and the "E". (I originally wrote "not counting the number
of digits appearing in the eponent" and changed it.) That is, the "dd"
after the "E" is just a place holder for some number of digits, just like
the "ddd" before the "." in Real.fmt FIX is a place holder for some number
of digits (not necessarily exactly 3). So, I would expect:
fmt (SCI (SOME 3)) 1.2 = "1.200E0"
> I think it is likely a typo in the spec that the "dd" after the "E[~]"
> is in a different font than the other "d.ddd", which makes me read it
> less like a variable number of digits.
I agree that it is probably a typo.
-------------------------------------------------------
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