Message45675
| Author |
phr |
| Recipients |
| Date |
2004年03月27日.06:57:57 |
| SpamBayes Score |
| Marked as misclassified |
| Message-id |
| In-reply-to |
| Content |
Logged In: YES
user_id=72053
How about just punting signed conversion. I don't think
two's complement makes much sense for arbitrary precision
longs. Have some separate representation for negative longs
if needed. If you call hex() on a large negative number,
you get a hex string with a leading minus sign. For base
256, you can't reserve a char like that, so I guess you have
to just throw an error if someone tries to convert a
negative long to a string. If you want a representation for
signed longs, ASN1 DER is probably an ok choice. I agree
with Guido that the binascii module is a good place to put
such a function. Twos complement can work if you specify a
fixed precision, but that sure complicates what this started
out as. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2007年08月23日 15:36:54 | admin | link | issue923643 messages |
| 2007年08月23日 15:36:54 | admin | create |
|