From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,LOTS_OF_MONEY, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,a96b706fab1e8c2c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-30 09:22:09 PST Path: supernews.google.com!sn-xit-03!supernews.com!freenix!sunqbc.risq.qc.ca!news3.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail From: "Bob Gratton" Newsgroups: comp.lang.ada References: <9e2x6.568987$JT5.15730002@news20.bellglobal.com> <9a2dnu$sff$1@nh.pace.co.uk> Subject: Re: Binary value X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Message-ID: Date: Fri, 30 Mar 2001 17:16:10 GMT NNTP-Posting-Host: 65.92.161.215 X-Trace: news20.bellglobal.com 985972570 65.92.161.215 (Fri, 30 Mar 2001 12:16:10 EST) NNTP-Posting-Date: Fri, 30 Mar 2001 12:16:10 EST Organization: Sympatico Xref: supernews.google.com comp.lang.ada:6257 Date: 2001-03-30T17:16:10+00:00 List-Id: I see... that answers half of my question. This presumes I wanna convert from binary to Integer. But is it possible to "convert" a Integer value to binary. For example, if one of my program's users enters a value, how can I show him the conversion in binary? "Marin David Condic" a �crit dans le message news: 9a2dnu$sff$1@nh.pace.co.uk... > It could not possibly get any easier. Ada allows you to express numeric > literals in bases other than 10. The syntax is B#nnnn# where B is a base and > the nnnn is the number in appropriate base representation. (octal, hex, > binary,... base 7 or 5 if you want to be unique!) So a binary number could > be expressed as: > > 2#1111_1111_1111_1111# > > or just for fun: > > 16#FFFF# > 8#177777# > 10#65535# > > IIRC, you can only use bases between 2..16 - but that covers most of the > ground anybody would want. > > Note also that burried somewhere in Text_IO are routines that will allow you > to print results using a base other than 10 - just in case you want to do a > little I/O with your bits... > > MDC > -- > Marin David Condic > Senior Software Engineer > Pace Micro Technology Americas www.pacemicro.com > Enabling the digital revolution > e-Mail: marin.condic@pacemicro.com > Web: http://www.mcondic.com/ > > > "Bob Gratton" wrote in message > news:9e2x6.568987$JT5.15730002@news20.bellglobal.com... > > Ok... now I know how to use bitwise operators... I'd like to know also how > > to convert an integer value to its equivalent in binary. > > > > e.g.: 123 => 1111011 > > > > Thanx again! > > > > Bob > > > > > >