Click here to Skip to main content
13,596,716 members
Click here to Skip to main content
Add your own
alternative version


24 bookmarked
Posted 3 Mar 2000

CInt96 v1.04 - 96 Bit Integers

, 3 Mar 2000
Rate this:
Please Sign up or sign in to vote.
A Freeware MFC class which provides 96 bit integers.
  • Download source files - 10 Kb
  • Introduction

    If you have every been doing any arithmetic which stretches the limits of the build in __int64 data type in Visual C++, then here is a class which gives you an extra 4 bytes to play with.

    Contacting the Author


    • Provides constructors which convert between all the basic types (including __int64) to CInt96.
    • All the standard operators are provided allowing the class to be used as if it was an intrinsic data type.
    • Methods are provided to convert to and from Hex, binary and decimal strings.
    • Functions are available to allow individual bits to be easily set or retrieved.

    The source zip file contains the CInt96 source code and a simple console program which exercises the class.


    • To use the class in your code simply include int96.cpp in your project and #include int96.h in which ever of your modules needs to make calls to the classes.
    • Your code will need to include MFC either statically or dynamically.
    • To see the class in action, have a look at the code in main() in the module test.cpp.


    v1.0 (11 July 1999)
    • Initial public release.

    V1.01 (17 October 1999)

    • Fix for the function FormatAsDecimal() which was failing when the number starts with a "10".

    V1.02 (26 October 1999)

    • Fixed bug in operator!=.
    • Fixed bug in operator^.
    • Fixed bug in operator|.
    • Fixed bug in operator&.
    • All relational and equality operators now return int instead of BOOL.
    • Provision of operators which convert back to basic C types.
    • Improved the performance of operator*.
    • Fixed problem with 0/0 which was returning 0 instead of the correct value of undefined, i.e. divide by 0 exception. Thanks to G.J.E. Visser for finding all these bugs <g>.

    V1.03 (28 October 1999)

    • Fixed another bug in operator!=.
    • Removed the use of MAXDWORD and replaced with 0xFFFFFFFF.

    V1.04 (5 December 1999)

    • Fixed problem with operator* which was giving incorrect results in some cases. Thanks go to G.J.E. Visser for finding this.

    Planned Enhancements

    • Optimize the code through the use of inlining and improved algorithms.
    • Generalize the class to make it arbitrary precision.
    • Improve the sample app as at the moment it just tests out most of the methods provided by CInt96.
    • If you have any other suggested additions, comments or bug fixes, please let me know so that I can try my best to incorporate them into the next version of CInt96.

    Contacting the Author

    PJ Naughter
    5 December 1999 <p>


    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here


    About the Author

    PJ Naughter
    United States United States
    No Biography provided

    You may also be interested in...

    Comments and Discussions

    -- There are no messages in this forum --
    Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
    Web03 | 2.8.180621.3 | Last Updated 4 Mar 2000
    Article Copyright 2000 by PJ Naughter
    Everything else Copyright © CodeProject, 1999-2018
    Layout: fixed | fluid