Re: Binary, Octal, Decimal, Hex!
Mark Manning wrote: Yakov Lerner wrote: On 9/11/06, Mark Manning <[EMAIL PROTECTED]> wrote: Yakov Lerner wrote: > On 9/11/06, Mark Manning <[EMAIL PROTECTED]> wrote: > >> It is fairly easy to check for inconsistencies in Binary, Octal, and Hex > > > I'm afraid C does not notion of binary numbers. > > Yakov > On some systems that answer is correct. On others it is not. :-) I'm aware of binary numbers in perl (0b101010101). But in C ? What exactly is syntax of "binary numbers in C" ? How does it look ? On which systems ? I never heard of "binary numbers in C" ... I am very curious to hear from you all details that you can provide. What exactly are those systems and how exactly the syntax looks ? Yakov Since I've been working with computers since the early 1970s and since I used B (the predecessor of C which was [and possibly still is] used in Canada), it is more than most likely that I am mixing and matching my languages or remembering an outdated version of C. Also, since at NASA (I was at NASA JSC in ClearLake/Houston) we had to do a lot of our own coding for various items (like a control chair so simulations could be done with the astronauts, or the fixed and motion based simulators, etc...) it is also likely that I was using macros someone else wrote to allow for binary input of numbers. (This was necessary in some cases because the hardware would only accept binary information some times. In many cases we would do inline assembly language within the C programs too.) The 70's and even the 80's were a dark time in computer programming because there were very few standards and not a lot of company's used them. (This is one of the really few things that Microsoft and Apple Computer helped to change. They do try to enforce the standards - on everyone else of course. Even though it seems they both also break their own standards every chance they get.) Like SGI which had it's own special interface for their graphic computers until X-Windows came along and then SGI switched to Linux as their OS basis. There were some "special" items to SGI's C to help handle the graphics in the pre-X-Windows days. Things became more standardized with X-Windows and then the Linux OS helped out even more. So take your pick. Don't really care. But there probably are still systems out there that have binary capabilities in their C languages to help out with whatever. Check out Sony's PlayStation 3. People are having to write very low-level code to get it to work. Makes me wonder if people are using C and if those compilers have special additions to them that would allow someone to write binary information directly to a part of the hardware to help boost the speed of it. If so, they might extend the C language via macros or a direct change to the compiler in order for everyone to get the most out of the computer. Still, I'm not going to rack my brain for exactly which system and where just because you want to know. It is not worth the time or effort on my part. Have fun! :-) Mark I suppose that with inline assembly, assembly-language syntax blocks could be included within C syntax (like mzscheme, perl, python, ruby and tcl syntax blocks within vim syntax) but that should be handled by the appropriate assembly-language syntax script, which ought to allow (e.g., for MASM) 11010011B (binary), 0D3H (hex), 343O or 343Q (Octal; my memory is failing) as well as 211D (decimal) and 211 (decimal by default) as synonymous; IIRC it also has floating-point numbers in decimal-point or exponential notation for use with the arithmetic coprocessor. Best regards, Tony.
Re: Binary, Octal, Decimal, Hex!
On 9/12/06, Mark Manning <[EMAIL PROTECTED]> wrote: Yakov Lerner wrote: > On 9/11/06, Mark Manning <[EMAIL PROTECTED]> wrote: > >> Yakov Lerner wrote: >> >> > On 9/11/06, Mark Manning <[EMAIL PROTECTED]> wrote: >> > >> >> It is fairly easy to check for inconsistencies in Binary, Octal, >> and Hex >> > I'm afraid C does not notion of binary numbers. >> On some systems that answer is correct. On others it is not. :-) > > > I'm aware of binary numbers in perl (0b101010101). But in C ? > What exactly is syntax of "binary numbers in C" ? How does it look ? > On which systems ? > I never heard of "binary numbers in C" ... > I am very curious to hear from you all details that you can provide. > What exactly are those systems and how exactly the syntax looks ? > > Yakov > ... Still, I'm not going to rack my brain for exactly which system and where Don't bother. C standard does not have binary numbers. (I'm sorry to disappoint you but B, immediate predecessor of C, did not have binary numbers, too). Yakov
Re: Binary, Octal, Decimal, Hex!
Yakov Lerner wrote: On 9/11/06, Mark Manning <[EMAIL PROTECTED]> wrote: Yakov Lerner wrote: > On 9/11/06, Mark Manning <[EMAIL PROTECTED]> wrote: > >> It is fairly easy to check for inconsistencies in Binary, Octal, and Hex > > > I'm afraid C does not notion of binary numbers. > > Yakov > On some systems that answer is correct. On others it is not. :-) I'm aware of binary numbers in perl (0b101010101). But in C ? What exactly is syntax of "binary numbers in C" ? How does it look ? On which systems ? I never heard of "binary numbers in C" ... I am very curious to hear from you all details that you can provide. What exactly are those systems and how exactly the syntax looks ? Yakov Since I've been working with computers since the early 1970s and since I used B (the predecessor of C which was [and possibly still is] used in Canada), it is more than most likely that I am mixing and matching my languages or remembering an outdated version of C. Also, since at NASA (I was at NASA JSC in ClearLake/Houston) we had to do a lot of our own coding for various items (like a control chair so simulations could be done with the astronauts, or the fixed and motion based simulators, etc...) it is also likely that I was using macros someone else wrote to allow for binary input of numbers. (This was necessary in some cases because the hardware would only accept binary information some times. In many cases we would do inline assembly language within the C programs too.) The 70's and even the 80's were a dark time in computer programming because there were very few standards and not a lot of company's used them. (This is one of the really few things that Microsoft and Apple Computer helped to change. They do try to enforce the standards - on everyone else of course. Even though it seems they both also break their own standards every chance they get.) Like SGI which had it's own special interface for their graphic computers until X-Windows came along and then SGI switched to Linux as their OS basis. There were some "special" items to SGI's C to help handle the graphics in the pre-X-Windows days. Things became more standardized with X-Windows and then the Linux OS helped out even more. So take your pick. Don't really care. But there probably are still systems out there that have binary capabilities in their C languages to help out with whatever. Check out Sony's PlayStation 3. People are having to write very low-level code to get it to work. Makes me wonder if people are using C and if those compilers have special additions to them that would allow someone to write binary information directly to a part of the hardware to help boost the speed of it. If so, they might extend the C language via macros or a direct change to the compiler in order for everyone to get the most out of the computer. Still, I'm not going to rack my brain for exactly which system and where just because you want to know. It is not worth the time or effort on my part. Have fun! :-) Mark
Re: Binary, Octal, Decimal, Hex!
On 9/11/06, Mark Manning <[EMAIL PROTECTED]> wrote: Yakov Lerner wrote: > On 9/11/06, Mark Manning <[EMAIL PROTECTED]> wrote: > >> It is fairly easy to check for inconsistencies in Binary, Octal, and Hex > > > I'm afraid C does not notion of binary numbers. > > Yakov > On some systems that answer is correct. On others it is not. :-) I'm aware of binary numbers in perl (0b101010101). But in C ? What exactly is syntax of "binary numbers in C" ? How does it look ? On which systems ? I never heard of "binary numbers in C" ... I am very curious to hear from you all details that you can provide. What exactly are those systems and how exactly the syntax looks ? Yakov
Re: Binary, Octal, Decimal, Hex!
On 9/11/06, Mark Manning <[EMAIL PROTECTED]> wrote: Yakov Lerner wrote: > On 9/11/06, Mark Manning <[EMAIL PROTECTED]> wrote: > > It is fairly easy to check for inconsistencies in Binary, Octal, and Hex > I'm afraid C does not notion of binary numbers. On some systems that answer is correct. On others it is not. :-) On some systems, the C compiler is standards compliant. On others, it is not. nikolai
Re: Binary, Octal, Decimal, Hex!
Yakov Lerner wrote: On 9/11/06, Mark Manning <[EMAIL PROTECTED]> wrote: It is fairly easy to check for inconsistencies in Binary, Octal, and Hex I'm afraid C does not notion of binary numbers. Yakov On some systems that answer is correct. On others it is not. :-)
Re: Binary, Octal, Decimal, Hex!
Hi! Sorry, new to the list and I was told not to just send replies privately but to post them publicly. (Damned if you do - damned if you don't!) No, you are not damned, it is just confusing if each of your replies starts a new thread. I have realized very late - after my previous mail -, that most of your numerous mails, which look like IRC postings each having a return receipt request, seem to be only one thread or so. Best wishes, Georg Dahn ___ To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com
Re: Binary, Octal, Decimal, Hex!
On 9/11/06, Mark Manning <[EMAIL PROTECTED]> wrote: Creating an error syntax that would highlight the problems rather than just identifying whether or not a number was a decimal number. Sure. A thought, though. This is going to get rather complex and how often have you actually mistyped a hexadecimal, binary, or decimal number? An octal is one thing, as a leading zero is sometimes mistakenly added, e.g., for alignment purposes or when pasting from a zero-padded output, when you really want a decimal, i.e., with eights and nines, not an octal. nikolai
Re: Binary, Octal, Decimal, Hex!
On 9/11/06, Mark Manning <[EMAIL PROTECTED]> wrote: It is fairly easy to check for inconsistencies in Binary, Octal, and Hex I'm afraid C does not notion of binary numbers. Yakov
Re: Binary, Octal, Decimal, Hex!
On Mon 11-Sep-06 3:02am -0600, Nikolai Weibull wrote: > This "stream of thought" mode you're using is more suited for IRC, see > http://www.vim.org/community.php. Alternately, the vim list is a good choice. And never add return receipt requests in posts to a mailing list. -- Best regards, Bill
Re: Binary, Octal, Decimal, Hex!
Georg Dahn wrote: Nikolai Weibull wrote: This "stream of thought" mode you're using is more suited for IRC, see http://www.vim.org/community.php. Yes. BTW, this is the list for development of Vim. Many of these Emails don't belong to the development list. General questions about Vim should be asked in the other list (vim@vim.org) if they aren't much more suited for IRC anyway. Best wishes, Georg Dahn Sorry, new to the list and I was told not to just send replies privately but to post them publicly. (Damned if you do - damned if you don't!)
Re: Binary, Octal, Decimal, Hex!
Nikolai Weibull wrote: On 9/11/06, Mark Manning <[EMAIL PROTECTED]> wrote: It is fairly easy to check for inconsistencies in Binary, Octal, and Hex because they have a fixed format. Decimal is not as easy due to there being integers, reals, and general format numbers (ie: #e+/-#) which are all grouped into the "Decimal" category. I'll think about it though. Maybe I can come up with something. :-) Actually, as I was sitting here typing this it popped into my head that such a test would actually fall under the Variable category rather than the Decimal category since variables can start with any character or an underscore; the opposite would be to start with something like a decimal number. A possibility maybe. :-) What /are/ you talking about? If you're discussing syntax highlighting, numbers usually fall under then Number group. Some syntax definitions highlight a leading zero as Special, as it does have special meaning, as it in some languages denotes an octal number. I have no idea of what you mean by "inconsistencies". This "stream of thought" mode you're using is more suited for IRC, see http://www.vim.org/community.php. nikolai Ok, here goes: Binary numbers usually have a leading specifier and can only contain a zero or one. Octal numbers usually have a leading specifier and can only contain the numbers 0-7 Hex numbers usually have a leading specifier and can only contain 0-9 and A-F. Decimail usually do not have a leading specifier, can have 0-9, a period, an "E", plus or minus, and in pretty much whatever combination you would like for it to be. So it is easier to say what it is than what it is not. Because unlike Binary, Octal, or Hex - there is no standard way to represent a decimal number. That is why there are three entries in the syntax files for how a number can be declared. We were talking about doing the opposite though. Creating an error syntax that would highlight the problems rather than just identifying whether or not a number was a decimal number. So my thoughts are that it can not be done in one command or maybe not easily. Got it now? Mark
Re: Binary, Octal, Decimal, Hex!
Nikolai Weibull wrote: This "stream of thought" mode you're using is more suited for IRC, see http://www.vim.org/community.php. Yes. BTW, this is the list for development of Vim. Many of these Emails don't belong to the development list. General questions about Vim should be asked in the other list (vim@vim.org) if they aren't much more suited for IRC anyway. Best wishes, Georg Dahn ___ Inbox full of spam? Get leading spam protection and 1GB storage with All New Yahoo! Mail. http://uk.docs.yahoo.com/nowyoucan.html
Re: Binary, Octal, Decimal, Hex!
On 9/11/06, Mark Manning <[EMAIL PROTECTED]> wrote: It is fairly easy to check for inconsistencies in Binary, Octal, and Hex because they have a fixed format. Decimal is not as easy due to there being integers, reals, and general format numbers (ie: #e+/-#) which are all grouped into the "Decimal" category. I'll think about it though. Maybe I can come up with something. :-) Actually, as I was sitting here typing this it popped into my head that such a test would actually fall under the Variable category rather than the Decimal category since variables can start with any character or an underscore; the opposite would be to start with something like a decimal number. A possibility maybe. :-) What /are/ you talking about? If you're discussing syntax highlighting, numbers usually fall under then Number group. Some syntax definitions highlight a leading zero as Special, as it does have special meaning, as it in some languages denotes an octal number. I have no idea of what you mean by "inconsistencies". This "stream of thought" mode you're using is more suited for IRC, see http://www.vim.org/community.php. nikolai
Binary, Octal, Decimal, Hex!
It is fairly easy to check for inconsistencies in Binary, Octal, and Hex because they have a fixed format. Decimal is not as easy due to there being integers, reals, and general format numbers (ie: #e+/-#) which are all grouped into the "Decimal" category. I'll think about it though. Maybe I can come up with something. :-) Actually, as I was sitting here typing this it popped into my head that such a test would actually fall under the Variable category rather than the Decimal category since variables can start with any character or an underscore; the opposite would be to start with something like a decimal number. A possibility maybe. :-) Mark