From: <fl...@us...> - 2012-06-11 20:57:49
|
Revision: 7573 http://mlton.svn.sourceforge.net/mlton/?rev=7573&view=rev Author: fluet Date: 2012-06-11 20:57:41 +0000 (Mon, 11 Jun 2012) Log Message: ----------- Use bit operations for real classification and low-level opeartions. Use Real{32,64}.cast{to,from}Word primitives for implementation of Real{32,64}.class and Real{32,64}.signBit. Real{32,64}.{to,from}Decimal should respect sign of nan values. Eliminates the need for C implementations of: IEEEReal.FloatClass.FP_{INFINITE,NAN,NORMAL,SUBNORMAL,ZERO} Real{32,64}.class (fpclassify) Real{32,64}.signBit (signbit) Real{32,64}.maxFinite Real{32,64}.minPos Real{32,64}.minNormalPos There is a minor inconsistency in the Standard ML Basis Library specification. IEEEReal.toString states: "If the sign field is true, a #"~" is prepended." This implies that a negative nan is converted to "~nan". IEEEReal.toString also states: "The composition toString o REAL.toDecimal is equivalent to REAL.fmt StringCvt.EXACT." However, REAL.{fmt,toString} states: "In all cases, ... NaN values are converted to the string "nan"." This implies that a negative nan is converted to "nan". This inconsistency is resolved in the implementation of the Basis Library by breaking the equivalence of "IEEEReal.toString o REAL.toDecimal" and "REAL.fmt StringCvt.EXACT" for the case of a negative nan. The former will return "~nan" (which is rationalized by the explicit sign field of the IEEEReal.decimal_approx type) and the latter will return "nan". Modified Paths: -------------- mlton/trunk/basis-library/primitive/basis-ffi.sml mlton/trunk/basis-library/primitive/check-real.sml mlton/trunk/basis-library/primitive/prim-real.sml mlton/trunk/basis-library/real/IEEE-real.sig mlton/trunk/basis-library/real/IEEE-real.sml mlton/trunk/basis-library/real/real.sig mlton/trunk/basis-library/real/real.sml mlton/trunk/runtime/basis/Real/IEEEReal-consts.c mlton/trunk/runtime/basis/Real/Real-consts.c mlton/trunk/runtime/basis-ffi.h mlton/trunk/runtime/gen/basis-ffi.def mlton/trunk/runtime/gen/basis-ffi.h mlton/trunk/runtime/gen/basis-ffi.sml mlton/trunk/runtime/platform/aix.c mlton/trunk/runtime/platform/aix.h mlton/trunk/runtime/platform/cygwin.h mlton/trunk/runtime/platform/darwin.h mlton/trunk/runtime/platform/freebsd.h mlton/trunk/runtime/platform/hpux.h mlton/trunk/runtime/platform/hurd.h mlton/trunk/runtime/platform/linux.h mlton/trunk/runtime/platform/mingw.h mlton/trunk/runtime/platform/netbsd.h mlton/trunk/runtime/platform/openbsd.h mlton/trunk/runtime/platform/solaris.c mlton/trunk/runtime/platform/solaris.h mlton/trunk/runtime/platform.h Removed Paths: ------------- mlton/trunk/runtime/basis/Real/class.c mlton/trunk/runtime/basis/Real/signBit.c This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ MLton-commit mailing list MLt...@li...; mlt...@ml... https://lists.sourceforge.net/lists/listinfo/mlton-commit |