Boost logo

Boost :

From: Maarten Kronenburg (M.Kronenburg_at_[hidden])
Date: 2006-05-30 15:51:14


Rene,
In the meantime the get_sub has been
added for bit access, see below.
This is not an iterator, but it may be
sufficient for access of the binary
representation.
Is this also usefull for you?

size_type highest_bit() const;
Returns: The bit number of the highest set bit.
Throws: invalid_argument_error when *this == 0
Remarks: The bit numbering starts with zero.
   The result is independent of sign.
Complexity: O(N)

size_type lowest_bit() const;
Returns: The bit number of the lowest set bit.
Throws: invalid_argument_error when *this == 0
Remarks: The bit numbering starts with zero.
  The result is independent of sign.
Complexity: O(N)

const integer get_sub( size_type startbit, size_type nbits ) const;
Returns: The sub integer with the nbits bits
   starting with bit number startbit.
Remarks: The bit numbering starts with zero.
   The result is independent of sign.
Complexity: O(N)
Notes: The return value is as if the integers are padded
   with zeros to infinity. This means that the result is 0
   when startbit > highest_bit().

"Rene Rivera" <grafik.list_at_[hidden]> wrote in message
news:447C4F69.3090603_at_redshift-software.com...
> Maarten Kronenburg wrote:
> > In the boost vault
> > http://boost-consulting.com/vault/
> > under Math - Numerics the document
> > infintdraft.pdf contains the
> > Proposal for an Infinite Precision Integer
> > for Library Technical Report 2, Draft.
> > Any comments are welcome.
>
> I see you addressed the memory management issues with the allocator. But
> I don't see a solution to the second point I raised in regards to access
> to a defined binary representation
> <http://article.gmane.org/gmane.comp.lib.boost.devel/142234>. In
> addition to the uses I mention in that thread. Such access is useful for
> implementing other optimal operations that the base integer may not
provide.
>
>
> --
> -- Grafik - Don't Assume Anything
> -- Redshift Software, Inc. - http://redshift-software.com
> -- rrivera/acm.org - grafik/redshift-software.com
> -- 102708583/icq - grafikrobot/aim - grafikrobot/yahoo
> _______________________________________________
> Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk