[Python-checkins] python/nondist/peps pep-0754.txt,1.1,1.2

goodger@users.sourceforge.net goodger@users.sourceforge.net
Wed, 14 May 2003 15:23:10 -0700


Update of /cvsroot/python/python/nondist/peps
In directory sc8-pr-cvs1:/tmp/cvs-serv5470

Modified Files:
	pep-0754.txt 
Log Message:
update from Gregory Warnes

Index: pep-0754.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0754.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** pep-0754.txt	12 Apr 2003 13:39:34 -0000	1.1
--- pep-0754.txt	14 May 2003 22:23:07 -0000	1.2
***************
*** 3,7 ****
  Version: $Revision$
  Last-Modified: $Date$
! Author: Gregory R. Warnes <warnes@users.sourceforge.net>
  Status: Draft
  Type: Standard Track
--- 3,7 ----
  Version: $Revision$
  Last-Modified: $Date$
! Author: Gregory R. Warnes <gregory_r_warnes@groton.pfizer.com> (Pfizer, Inc.)
  Status: Draft
  Type: Standard Track
***************
*** 17,22 ****
  This PEP proposes an API and a provides a reference module that
  generates and tests for IEEE 754 double-precision special values:
! positive infinity (Inf), negative infinity (-Inf), and not-a-number
! (NaN).
  
  
--- 17,21 ----
  This PEP proposes an API and a provides a reference module that
  generates and tests for IEEE 754 double-precision special values:
! positive infinity, negative infinity, and not-a-number (NaN).
  
  
***************
*** 27,34 ****
  algorithmic rules for floating point arithmetic.  Included in the
  standard is a set of constants for representing special values,
! including positive infinity (Inf), negative infinity (-Inf), and
! indeterminate or non-numeric results (NaN).  Most modern CPUs
! implement the IEEE 754 standard, including the (Ultra)SPARC, PowerPC,
! and x86 processor series.
  
  Currently, the handling of IEEE 754 special values in Python depends
--- 26,33 ----
  algorithmic rules for floating point arithmetic.  Included in the
  standard is a set of constants for representing special values,
! including positive infinity, negative infinity, and indeterminate or
! non-numeric results (NaN).  Most modern CPUs implement the
! IEEE 754 standard, including the (Ultra)SPARC, PowerPC, and x86
! processor series.
  
  Currently, the handling of IEEE 754 special values in Python depends
***************
*** 58,63 ****
  like::
  
!     Inf = 1e300**2
!     NaN = Inf/Inf
  
  to obtain positive infinity and not-a-number constants.  However, the
--- 57,62 ----
  like::
  
!     PosInf = 1e300**2
!     NaN = PosInf/PosInf
  
  to obtain positive infinity and not-a-number constants.  However, the
***************
*** 65,70 ****
  possible alternative is to use::
  
!     Inf = 1e300000
!     NaN = Inf/Inf
  
  While this does not generate an error with current Python
--- 64,69 ----
  possible alternative is to use::
  
!     PosInf = 1e300000
!     NaN = PosInf/PosInf
  
  While this does not generate an error with current Python
***************
*** 101,107 ****
  
  NaN
!     IEEE 754 "Not a Number" value
  
! Inf, PosInf
      IEEE 754 Positive Infinity value
  
--- 100,106 ----
  
  NaN
!     Non-signalling IEEE 754 "Not a Number" value
  
! PosInf
      IEEE 754 Positive Infinity value
  
***************
*** 113,130 ****
  ---------
  
! is_NaN(value)
      Determine if the argument is a IEEE 754 NaN (Not a Number) value.
  
! is_Inf(value), is_PosInf(value)
!     Determine if the argument is a IEEE 754 positive infinity value
  
! is_NegInf(value)
!     Determine if the argument is a IEEE 754 negative infinity value
  
! is_Finite(value)
      Determine if the argument is an finite IEEE 754 value (i.e., is
!     not NaN, positive or negative infinity)
  
! is_Infinite(value)
      Determine if the argument is an infinite IEEE 754 value (positive
      or negative infinity)
--- 112,129 ----
  ---------
  
! isNaN(value)
      Determine if the argument is a IEEE 754 NaN (Not a Number) value.
  
! isPosInf(value)
!     Determine if the argument is a IEEE 754 positive infinity value.
  
! isNegInf(value)
!     Determine if the argument is a IEEE 754 negative infinity value.
  
! isFinite(value)
      Determine if the argument is an finite IEEE 754 value (i.e., is
!     not NaN, positive, or negative infinity).
  
! isInf(value)
      Determine if the argument is an infinite IEEE 754 value (positive
      or negative infinity)
***************
*** 140,153 ****
  >>> val
  Infinity
! >>> fpconst.is_Inf(val)
  1
! >>> fpconst.Inf
  Infinity
  >>> nval = val/val # should result in NaN
  >>> nval
  NaN
! >>> fpconst.is_NaN(nval)
  1
! >>> fpconst.is_NaN(val)
  0
  
--- 139,152 ----
  >>> val
  Infinity
! >>> fpconst.isInf(val)
  1
! >>> fpconst.PosInf
  Infinity
  >>> nval = val/val # should result in NaN
  >>> nval
  NaN
! >>> fpconst.isNaN(nval)
  1
! >>> fpconst.isNaN(val)
  0