develooper Front page | perl.perl5.porters | Postings from June 2015

Re: Coverity finding: shift by negative

Thread Previous | Thread Next
From:
Jarkko Hietaniemi
Date:
June 25, 2015 11:20
Subject:
Re: Coverity finding: shift by negative
Message ID:
558BE3DF.4010208@iki.fi
On Wednesday-201506-24 22:27, Ricardo Signes wrote:
> What we need is a conceptual model of how Perl handles bit strings.  We have

The core Perl doesn't have bit strings.

What I mean by this is that "hexagram" isn't a bit string of 64 bits, 
which one could AND, OR, XOR, NOT, shift, and so forth.  That's why 
Bit::Vector.

What Perl has this strange window where "numbers" (based on the platform
floats) can be mapped (truncated) into platform fixed length integers, 
and those integers can be manipulated as tiny fixed length (so no too 
much left shift) bit arrays, which however fast degrade into floats, 
because Perl.

One could argue that with vec() one can do bit strings but that's only 
get/set access, no more.

> operators that treat things as "numbers," which tends to mean floats, and as
> "strings" which basically always means Unicode character strings.


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About