This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients docs@python, mark.dickinson, rhettinger
Date 2011-06-04.15:14:42
SpamBayes Score 1.1071994e-08
Marked as misclassified No
Message-id <1307200483.18.0.174086604847.issue12245@psf.upfronthosting.co.za>
In-reply-to
Content
float_info.rounds is a bit of an odd fish, and I think it was probably a mistake to include it in sys.float_info in the first place.

All the other float_info fields relate to parameters of the floating-point format, which is fixed, useful information.  In contrast, float_info.rounds gives information about the current FPU settings, which are variable.  Moreover, it doesn't do that very well:  all it does is give information about the FPU settings at the time that Python was compiled, which isn't really very helpful (and perhaps not even that:  it reports the value of FLT_ROUNDS, which may not even reflect those FPU settings accurately).  I wouldn't mind seeing this field fade quietly into obscurity.

FWIW, the value is taken from C's FLT_ROUNDS, and its interpretation is *supposed* to be the following (C99 5.2.4.2.2, para 7):

  -1:  The compiler was unable to determine rounding mode.
   0:  Round towards zero.
   1:  Round to nearest (this is the most likely value for
       float_info.rounds on common platforms).
   2:  Round towards positive infinity
   3:  Round towards negative infinity.
History
Date User Action Args
2011-06-04 15:14:43mark.dickinsonsetrecipients: + mark.dickinson, rhettinger, docs@python
2011-06-04 15:14:43mark.dickinsonsetmessageid: <1307200483.18.0.174086604847.issue12245@psf.upfronthosting.co.za>
2011-06-04 15:14:42mark.dickinsonlinkissue12245 messages
2011-06-04 15:14:42mark.dickinsoncreate