Talk:Find first and last set bit of a long integer: Difference between revisions

(→‎More Clarification "set bit": added comment about integers stored in "binary" form. -- ~~~~)
Line 35:
 
Yes, I read the task's description. Integers are stored as characters in REXX. So the bits of the integer are just the bits of the characters that are used to describe (hold) the value of the integer. Negative integers normally (but not always) start with the character '-' (the minus sign). Integers can also have any number of leading (and/or trailing and/or imbedded in some cases) blanks, but that's another complication. Integers also can have a leading plus (+) sign. It appears to me that most everyone is making the assumption that integers are stored in binary, and that's not necessary true for all languages. A few tasks seem to be "C"-centric. It would make more sense (to me) not to assume how integers are stored, but word the task something like: find the first and last set bit of an integer when (or if) stored in a binary form --- and even that can be misinterpreted --- but it would preclude some languages, however. I would hope that these tasks wouldn't be worded to do such things (preclusions or exclusions). When using the word LONG, a (huge?) assumption is already being made. REXX has no such thing as short, long, longlong, etc. And, as it was said, it's a bit foggy (about integers). The REXX language doesn't have, in the true sense (whatever that means), integers. It has character strings, and some character strings are numbers. And some numbers are whole numbers (I guess you could call them integers), and some whole numbers look a lot like integers. Hold on, this train has a caboose. A whole number (in REXX) is a number that has no fractional part when expressed within the current NUMERIC DIGITS (that's the size or width, if you will, of the largest "mantissa" of a number --- the default is 9). So "1.5e5" is a whole number, so would be "7.9999999999999999", and " + 5 " (I know the latter looks like more of an expression than how an integer would be stored internally). -- [[User:Gerard Schildberger|Gerard Schildberger]] 17:28, 8 May 2012 (UTC)
 
:: It's not valid to say that "the bits of the integer are just the bits of the characters that are used to describe (hold) the value of the integer". Proof: Change the leading bit from a 1 to a 0. The result is not a valid integer. --[[User:Rdm|Rdm]] 17:52, 8 May 2012 (UTC)
 
 
6,951

edits