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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a96b706fab1e8c2c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-02 10:04:13 PST Newsgroups: comp.lang.ada Path: supernews.google.com!sn-xit-03!supernews.com!cyclone-sjo1.usenetserver.com!news-out-sjo.usenetserver.com!feed2.onemain.com!feed1.onemain.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.skycache.com!Cidera!news-reader.ntrnet.net!uunet!ash.uu.net!xyzzy!nntp From: Jeffrey Carter Subject: Re: Binary value X-Nntp-Posting-Host: e246420.msc.az.boeing.com Content-Type: text/plain; charset=us-ascii Message-ID: <3AC8AC34.CDEEB50F@boeing.com> Sender: nntp@news.boeing.com (Boeing NNTP News Access) Content-Transfer-Encoding: 7bit Organization: The Boeing Company X-Accept-Language: en References: <9e2x6.568987$JT5.15730002@news20.bellglobal.com> <9a2dnu$sff$1@nh.pace.co.uk> Mime-Version: 1.0 Date: Mon, 2 Apr 2001 16:43:32 GMT X-Mailer: Mozilla 4.5 [en]C-CCK-MCD Boeing Kit (WinNT; U) Xref: supernews.google.com comp.lang.ada:6357 Date: 2001-04-02T16:43:32+00:00 List-Id: "chris.danx" wrote: > > > 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. > > Suppose you have the value 123 in binary. To convert to binary you need to > follow this algorithm. > [incorrect algorithm deleted] Ignoring the question of what the correct algorithm is, why would you want to implement this (specific to binary) algorithm, when Text_IO already provides this capability for any base from 2 to 16? It's much easier and more flexible to use Text_IO.Integer_IO.Put and extract the part of the result between the '#'s. Jeffrey Carter