Re: [ID 20010723.001] perl 5.6.1: BigInt booleans cannot handle
by Tels other posts by this author
Jul 23 2001 9:45PM messages near this date
Re: [ID 20010723.001] perl 5.6.1: BigInt booleans cannot handle
|
[PATCH perl@11446] util.c: return required in Perl_my_fork
-----BEGIN PGP SIGNED MESSAGE-----
Moin,
On 23-Jul-01 John Peacock tried to scribble about:
> Tels wrote:
> >
> > "However, if you throw in a negative operand you get some very strange
> > behavior." - Indeed ;)
> >
> > I am unsure how to repeat this. The result of -1 & -1 highly depends on
> > the
> > width of a Perl scalar. Since Bigint is by definition "infinite width",
> > the
> > result should probably be something like +inf :-) Seriously, I do not
> > know
> > how to repeat Perl's behaviour without assuming a specific width.
> > Anyway,
> > your program looking for -1 & -1 beeing 4294967295 will fail on any
> > platform not having 32 bit (like 64 bit).
> >
> > Has anybody any comments or ideas on what to do?
> >
>
> Yes, I have a comment. Don't support And, Or, XOr, Not, Shift, etc. on
> any BigInt objects.
Shift, And, Xor, and Or make perfect sense with positive numbers.
Anyway, I am sure you want to tell me it is possible to "remove" something
from BigInt, while always telling me I can't "remove" or "change" anything
which would breaking existing code.
> They are artifacts of the underlying C-Library
> being able to do Boolean math on integers.
1 & 2 is defined even for BigInts.
I agree that one can not support negative values or do bit-wise-not, and
these things will stay out. But what is already there will remain.
> As you yourself state,
> BigInt is infinite width - Not will flip every bit out to infinity; let
> me know when you get there. ;~)
Schedules for tomorrow ;)
> I never thought these were good additions to the module.
Thats not the point. Somebody added them long ago, and now they must stay.
> I'll even
> bet you I can find the e-mail that I said they were not appropriate
> additions. Boolean math was never what BigInt/BigFloat was intended to
> deal with.
But it was added none-theless.
Any more ideas?
Cheers,
Tels
- --
perl -MMath::String -e 'print Math::String-> from_number("215960156869840440586892398248"),"\
n"'
http://bloodgate.com/thief/ Thief - The Dark Project
http://bloodgate.com/perl My current Perl projects
http://freedomforlinks.de Fight for your right to link.
PGP key available on http://bloodgate.com/tels.asc or via email
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: latin1
iQEVAwUBO1yaYHcLPEOTuEwVAQEAngf+Jd2YgaAbhL7ArSHCw9zOx6SLLzWPAtu5
spYx+ZbO5AbTmRAAMIhRMyIyMtteI/G4YNQxZt5Q3Pi0ELoSlKe/H2d6vd0zekGY
y6b/75LT9dOvV9rb8blNaEzshGiWlol/Fmxqeny7L+ff1FoYuV5ahJ9ha6sP4pdI
UkvaHS8oYWW2wYSJv9l5Z6sP8VRP3U4nklwxPjD/yY43gtHm2fVtsnTuD6JhgXWm
D1F9T7/AAGME354nTL0c7Sb+/8ZdYt166ETN2fUjA2MGR/dj+ZXIa60PiiXzRWFX
RU80FZryzk9DLk4+f24fiHoEV+iBESSRFV0hTyvAgm9jAfmwsv1tPA==
=s6A+
-----END PGP SIGNATURE-----
Thread:
John Peacock
Nick Ing-Simmons
Abigail
Tels
Tels
|