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 | rhettinger |
|---|---|
| Recipients | facundobatista, gvanrossum, jyasskin, mark.dickinson, rhettinger |
| Date | 2008年01月11日.21:26:04 |
| SpamBayes Score | 0.0036526972 |
| Marked as misclassified | No |
| Message-id | <1200086769.56.0.671574012292.issue1682@psf.upfronthosting.co.za> |
| In-reply-to |
| Content | |
|---|---|
> If the consensus is that Decimal should not implement Real,
> I'll reply to that thread and withdraw the patch.
Thanks. That would be nice.
> Raymond, do you want me to add Decimal.__init__(Rational)
> in this patch
How about focusing on the rational module and when you've done, I'll
adapt the Decimal constructor to accept a rational input.
> I don't understand the comment about scaling down long integers.
My understanding is that you're going to let numerators and denominators
grow arbitrarily large. When they get over several hundred digits each,
you will have to scale the down before converting to a float. For
example when numerator=long('2'*400+'7') and
denominator=long('3'*400+'1'), the long-->float conversion will
overflow, so it is necessary to first scale-down the two before
computing the ratio: scale=325;
float_ratio=float(numerator>>scale)/float(denominator>>scale) |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2008年01月11日 21:26:09 | rhettinger | set | spambayes_score: 0.0036527 -> 0.0036526972 recipients: + rhettinger, gvanrossum, facundobatista, mark.dickinson, jyasskin |
| 2008年01月11日 21:26:09 | rhettinger | set | spambayes_score: 0.0036527 -> 0.0036527 messageid: <1200086769.56.0.671574012292.issue1682@psf.upfronthosting.co.za> |
| 2008年01月11日 21:26:05 | rhettinger | link | issue1682 messages |
| 2008年01月11日 21:26:04 | rhettinger | create | |