Talk:Integer (computer science)
From Wikipedia, the free encyclopedia
Contents |
[edit] homed integer
homed integer pops up in the VisualC++ header files in reference to the DEC Alpha. Anybody know what that's about? Hackwrench 21:08, 5 November 2005 (UTC)
Finally found the relevant MSDN article.[1] Hackwrench 22:48, 5 November 2005 (UTC)
[edit] Word
(this was originally under Quadword)
I think this probably isn't adequate. I mean, I know what "unit," "computer memory or storage," "four," and "word" all mean, but I still don't know what "quadword" means (at least, I don't think I do). Isn't that interesting? --LS---- That is because no one has explained how many bytes are in a word. In IBM/370 Assembler a word has 32 bits or 4 bytes. A doubleword is the length of 2 words, thus 64 bits or 8 bytes. I was entering something about this under word with a one word instruction as an example and found someone disagreeing with me---I give up. Rose Parks
- problem is that different machines have different word sizes
OK, different problem: if you use "word" without further ado, many people reading the article won't know that you mean something different from what is ordinarily meant by "word."
I found this link on a page with byte...what was I to think? RoseParks
The article asserts that now word usually means 16 bits but I think it still means "most efficient unit size on some particular architecture" or "architecture defined sequential packing of bits". What do others think? --drj
- I think the author is showing his/her IBM PC x86 bias by saying a word is 16 bits.
I have been around enough architectures that I consciously don't decide how big a word is, until someone tells me.
- Somewhen in the past, drj was completely right, word meant the machine's "native" bit width, i.e. registers would always contain a word. But I think the trend to call 16 bits a word always, even outside of the now quite rare 16-bit beasts, is definitely there. This may be due to the wintel juggernaut, but it may also be due to there being a need to call 16 bits (and 32 bits, etc.) something. Word is certainly not the best choice, but most people that are not chip designers seem to find it adequate.
Despite the dominance of Wintel I still couldn't find enough evidence to support the case for word usually meaning 16 bits (for example count "16 bit word" versus "32 bit word" on altavista). So I deleted that claim from the head page. I can believe that amongst programmers that have only been exposed to wintel boxes word usually means 16 bits, but that not what was claimed. I don't really want to fight a battle over this but I would like some evidence. --drj
Likewise I'm not sure about 'longword' and 'long' as always meaning 32 bits. There are existing architectures where the C type 'long' is 64 bits. --Matthew Woodcraft
I think the article is clear enough about the terms being somewhat ambiguous (how's that for a .sig quote!) --LDC
[edit] Redirect
It strikes me that some of the information on this page is duplicated in the articles word, byte etc. Perhaps we should move it to a single place, and redirect from the others? --Uriyan
[edit] SI units?
picking a nit: As far as I know (and the SI entry supports me) terms like "megabyte" are not, in any way, SI measurements. The section that compares the power-of-ten meanings of the prefixes with the power-of-two meanings of the prefixes is fine, because it is describing the prefixes. However, "hard disk manufacturers describe their products using the SI units" seems inaccurate. - Wmarkham
- Decent nitpick. "SI" is indeed properly used only to refer to the specific set of units blessed by that standard. Informally, though, people do tend to use it to refer to anything measured in a metric fashion (i.e. powers of ten). I decided to drop out all the talk about hard drives and just leave the illustration of the difference, and the cross-reference to binary prefix, where the controversy is covered much better. Zack 18:23, 27 August 2005 (UTC)
- It's not about SI *units*, it's about SI *prefixes*. Examples for units are meter, gramm, pascal, Kelvin, Joule. Mega always meant and always will mean "Million" which is exactly 10^6 or 1000000. --82.141.58.16 16:04, 18 October 2006 (UTC)
Maybe cover the int() function present in lots of languages/math packages? — Omegatron 07:27, 17 October 2005 (UTC)
[edit] Char?
Why are char datatypes discussed here? char datatypes represent a character, not an integer. And how can a signed char exist (characters are textual, not numeric). --208.138.31.76 (talk) 14:44, 7 January 2008 (UTC)
- Well, in C/C++ (and probably others), chars can be signed or unsigned, and if explicitly declared as such, are considered an integral type. Oli Filth(talk) 19:38, 7 January 2008 (UTC)
-
- Thank you for clearing that one up. By the way, (as far as I know)Java's
chartype is a strict Unicode implementation (I'm not so sure about .NET though) --208.138.31.76 (talk) 21:13, 7 January 2008 (UTC)
- Thank you for clearing that one up. By the way, (as far as I know)Java's
-
- I have a little test for the Java
chartype.
- I have a little test for the Java
public static void main(String[] args) { char a = 'H';// 'H' is a character literal char b = 'e'; char c = 'l'; char d = 'o'; char e = ','; char f = ' '; char number = 42;// an integer stored in a char variable System.out.println(a + b + c + c + d + e + f + number); // what would be printed here? }
-
- This program assigns values to
charvariables. Because addition is defined for all integral types, the + operator could possibly be either integer addition or string concatenation.
- This program assigns values to
-
- I have done some Java programming before and, as far as I am concerned, a
charis a one-character string. I have never tried to concatenate twochars or acharand an integer, only acharand a string.
- I have done some Java programming before and, as far as I am concerned, a
-
- What would this program print? An integer or a string starting with "Hello, "? --208.138.31.76 (talk) 16:12, 8 January 2008 (UTC)
-
-
- This would demostrate how the
chartype works - as text or an integer. The Java spec also states that the addition operator is defined for all integral types (includingchar) and, becauseprintlnis overloaded for strings and integers, the output depends on whether + is used for integer addition (returning anint) or concatenation (returning a string). This could show that'H' + 'i'may not be the same as"Hi". --208.138.31.76 (talk) 14:53, 9 January 2008 (UTC)
- This would demostrate how the
-

