Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Java versus C Speed Comparison

Author: Miguel A. Ballicora

Date: 13:44:26 01/11/03

Go up one level in this thread


On January 11, 2003 at 11:40:00, Robert Hyatt wrote:

>What do you suppose will happen when we have 64 bit machines with 128 bit
>integers?  Care to guess what that will do to portability when you try to
>send binary files around between a 32 bit and a 64 bit architecture?  Then
>you might begin to see _the_ problem with the data types as they exist.

To send binary files portably you have to do it byte by byte, so it is the same
no matter what system you use. You cannot send an int32 as a block, that is not
portable at all no matter what system you use.

>>Even if you want something very specific you can use unsigned bitfields so they
>>will wrap after 12, 17 or whatever bits you want. Generally using the 'and' is
>>so simple that it doesn't justify to be bothered.
>
>
>Sorry but that is wrong.  Bitfields are not well-defined in the standard.
>Which end do they start from?  You instantly see the problem with using them.
>And trying to put them into a structure adds a random amount of padding,
>the random amount being the unused bits in a native "thing" the compiler has
>to use, which is yet another problem.

It does not matter if you use one bitfield per structure just to use a number
with "x bits" if you really want that number defined in that way.

Miguel




This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.