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 belopolsky, drj, mark.dickinson, vstinner
Date 2008-12-09.16:51:55
SpamBayes Score 9.074601e-05
Marked as misclassified No
Message-id <1228841516.64.0.92765264089.issue3166@psf.upfronthosting.co.za>
In-reply-to
Content
[Alexander]
> I also wonder whether round to nearest float can be implemented 
without
> floating point arithmetics.  I would think round towards zero should 
be
> a simple matter of extracting an appropriate number of bits from the
> long and round to nearest would at most require a long addition.

The idea's attractive.  The problem is finding an integer type that's 
guaranteed to have enough bits to store the mantissa for the float 
(probably plus one or two bits more for comfort);  for IEEE 754 this 
means a 64-bit integer type, and there aren't any of those in C89.

(One could use two 32-bit integer variables, but that's going to get 
messy.)
History
Date User Action Args
2008-12-09 16:51:56mark.dickinsonsetrecipients: + mark.dickinson, belopolsky, vstinner, drj
2008-12-09 16:51:56mark.dickinsonsetmessageid: <1228841516.64.0.92765264089.issue3166@psf.upfronthosting.co.za>
2008-12-09 16:51:56mark.dickinsonlinkissue3166 messages
2008-12-09 16:51:55mark.dickinsoncreate