I saw may programmers using HEXADECIMAL number to describe value and I was wonder what is the BENEFIT of using HEXADECIMAL instead of regular decimal number.  For example :  &lt;?php  fread( $myFile, 0x594 ); //vs fread( $myFile, "1428" );  ?&gt;   And more importantly,  How do I get to that hexadecimal value ?  I was trying echo hexdec (1428); and I'm receiving 5160 and not 0x594.  What am I doing wrong here ?
33306
Hey! I was looking at this code at   I noticed that in some situations they used hex numbers, like in line 134:  for (j = 1; val &amp;&amp; j &lt;= 0x80; j &lt;&lt;= 1, q++)   Now why would they use the 0x80? I am not that good with hex but I found an online hex to decimal and it gave me 128 for 0x80.  Also before line 134, on line 114 they have this:  small_n = (n &amp; 0xffff0000) == 0;   The hex to decimal gave me 4294901760 for that hex number. So here in this line they are making a bit AND and comparing the result to 0??  Why not just use the number? Can anyone please explain and please do give examples of other situations.  Also I have seen large lines of code where it's just hex numbers and never really understood why :(
99240
I write financial applications where I constantly battle the decision to use a double vs using a decimal.  All of my math works on numbers with no more than 5 decimal places and are not larger than ~100,000. I have a feeling that all of these can be represented as doubles anyways without rounding error, but have never been sure.  I would go ahead and make the switch from decimals to doubles for the obvious speed advantage, except that at the end of the day, I still use the ToString method to transmit prices to exchanges, and need to make sure it always outputs the number I expect. (89.99 instead of 89.99000000001)  Questions:   Is the speed advantage really as large as naive tests suggest? (~100 times) Is there a way to guarantee the output from ToString to be what I want? Is this assured by the fact that my number is always representable?   UPDATE: I have to process ~ 10 billion price updates before my app can run, and I have implemented with decimal right now for the obvious protective reasons, but it takes ~3 hours just to turn on, doubles would dramatically reduce my turn on time. Is there a safe way to do it with doubles?
26607
Is the concept of even/odd numbers applicable to decimal numbers? For e.g. - 4.222 is a even number?
110729
Why do computers only use 0 and 1? Won't the addition of other numbers such as 2 or 3 speed up computers? Also, 2 and 3 can be used to shorten the bit-length of integers (2 and 3 can be used to end an integer, so that the number 1 only needs one two bits.)..  Why is binary computer more preferred?
9902
After learning about the binary number system (only 2 symbols, i.e. 0 and 1), I just thought why did we adopt the decimal number system (10 symbols) after all?  I mean if you go to see, it's rather inefficient when compared to the octal (8 symbols) and the hexadecimal (16 symbols)?
38029
I am trying configure the Calculator to do some binary to hexadecimal conversions but I can't seem to get to scientific mode. Please can someone tell me how I configure?
6769
In PHP, is there an easy way to convert a number to a word? For instance, 27 to twenty-seven.
73904
When is it a good idea to use ?  I sometimes see this in code samples of PHP. Does this handle DOS/Mac/Unix endline issues?
36199
I have the need for a hexadecimal token that is smaller than the normal length of the hexadecimal representation of a  hash.  Should I take the first bits or the last bits? Which of them contain the most entropy?
107627
Is it the same convention as those used in known programming languages such as Java and C? I'm trying to create a lot of variables and I want it to start with a number, but I'm not sure if it's okay.
91881
Does anyone know how to get the IP address in decimal or hex from standard IP address format string ("xxx.xxx.xxx.xxx")?  I've tried to use the inet_addr() function but didn't get the right result.  I tested it on "84.52.184.224"  the function returned 3770168404 which is not correct (the correct result is 1412741344).  Thanks!
118343
I'd like to display the binary (or hexadecimal) representation of a floating point number.  I know how to convert by hand (using the method ), but I'm interested in seeing code samples that do the same.  Although I'm particularly interested in the C++ and Java solutions, I wonder if any languages make it particularly easy so I'm making this language agnostic.  I'd love to see some solutions in other languages.  EDIT: I've gotten good coverage of C, C++, C#, and Java.  Are there any alternative-language gurus out there who want to add to the list?
122305
In a document, is it possible to change the base in which the numeration is written? The default numeration is decimal, but I would like to use an octal or hexadecimal numeration for instance.  Also, when I use a document class 'book' or 'report', how can I set a negative numeration before the main text? What I mean by this is that instead of small latin numeration (i, ii, iii, iv, ...) I would like the pages to decrease with a negative sign in front. Is there a way to do so?
101326
I have never used octal numbers in my code nor come across any code that used it (hexadecimal and bit twiddling notwithstanding).  I started programming in C/C++ about 1994 so maybe I'm too young for this? Does older code use octal? C includes support for these by prepending a 0, but where is the code that uses these base 8 number literals?
63730
"" (number $5$).  I'm looking at this, and i'm not sure what the $\equiv$ means in this instance? I know the rest of the values, but what does $\equiv$ mean right now?  Thanks in advance!
5691
Is there a better way of getting this result? This function fails if num has more digits than digits, and I feel like it should be in the library somewhere (like Integer.toString(x,"%3d") or something)  static String intToString(int num, int digits) {     StringBuffer s = new StringBuffer(digits);     int zeroes = digits - (int) (Math.log(num) / Math.log(10)) - 1;      for (int i = 0; i &lt; zeroes; i++) {         s.append(0);     }     return s.append(num).toString(); }
68752
I downloaded Hex Workshop, and I was told to read a .dbc file.     It should contain 28,315 if you read   offset 0x04 and 0x05   I am unsure how to do this? What does 0x04 mean?