Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple question

Status
Not open for further replies.

ya0037

Programmer
Oct 7, 2010
30
DE
Hi,

I am very new in c++ so excuse me for my question.

Please sb kindly tell me what does the below sentence means?
Code:
static const unsigned int d1=0xDEADBEEF ^ (0x1fc4ce47*(d^(d>>13)));

My question is about what is 0xDEADBEEF or 0x1fc4ce47 ?
If I want to write a description for this so any programmer no matter what kind of language he or she uses can implement this, what should I say?

Kind regards,
 
Sorry I also have another question:

Code:
static const unsigned int oWeylOffset=0x8009d14b;

what does the above expression means?

I know the whole meaning of that, my question arises from that I have read that:

unsigned int is 4 Bytes precision but the above number is more than the range of 4 bytes precision integer it is something like 16 Bytes.

You know the problem is that I am a Fortran programmer and here at c++ I am totally confused. If I want to write the above expression in Fortran
Writing the 4 bytes precision is not working
Code:
Integer(Kind = 4), Parameter :: oWeylOffset = Z'8009d14b'

So, I have to write :
Code:
Integer(Kind = 16), Parameter :: oWeylOffset = Z'8009d14b'

less than this precision the code will be stopped with error.

Any idea? Please help me through this, as the manual says that unsigned int is 4 Bytes precision, how is it possible.

Cheers,


 
Hi

That value perfectly feets 4 bytes :
[tt]static const unsigned int oWeylOffset=0x[highlight #fcc]80[/highlight][highlight #cfc]09[/highlight][highlight #ccf]d1[/highlight][highlight #ffc]4b[/highlight];[/tt]

4 bytes can hold values in range 0..4[small] [/small]294[small] [/small]967[small] [/small]295, more than enough for 2[small] [/small]148[small] [/small]127[small] [/small]051.

ya0037 said:
My question is about what is 0xDEADBEEF or 0x1fc4ce47 ?
Now after your second question I have the feeling you are confused by C's hexadecimal notation. The "0x" prefix means the following number is represented in base 16. So 0xDEADBEEF = 3[small] [/small]735[small] [/small]928[small] [/small]559 and 0x1fc4ce47 = 532[small] [/small]991[small] [/small]559.


Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top