Message77435
[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.) |
|
Date |
User |
Action |
Args |
2008-12-09 16:51:56 | mark.dickinson | set | recipients:
+ mark.dickinson, belopolsky, vstinner, drj |
2008-12-09 16:51:56 | mark.dickinson | set | messageid: <1228841516.64.0.92765264089.issue3166@psf.upfronthosting.co.za> |
2008-12-09 16:51:56 | mark.dickinson | link | issue3166 messages |
2008-12-09 16:51:55 | mark.dickinson | create | |
|