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,252713cea9bdfef9 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-02-12 04:11:11 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!t-online.de!news-FFM2.ecrc.net!news.iks-jena.de!lutz From: lutz@iks-jena.de (Lutz Donnerhacke) Newsgroups: comp.lang.ada Subject: Re: convert integer base10 into base16 Date: Tue, 12 Feb 2002 12:10:50 +0000 (UTC) Organization: IKS GmbH Jena Message-ID: References: <8fe5cfbb.0202120405.19690c26@posting.google.com> NNTP-Posting-Host: taranis.iks-jena.de X-Trace: branwen.iks-jena.de 1013515850 10945 217.17.192.37 (12 Feb 2002 12:10:50 GMT) X-Complaints-To: usenet@iks-jena.de NNTP-Posting-Date: Tue, 12 Feb 2002 12:10:50 +0000 (UTC) User-Agent: slrn/0.9.6.3 (Linux) Xref: archiver1.google.com comp.lang.ada:19922 Date: 2002-02-12T12:10:50+00:00 List-Id: * c-kif-kif wrote: >It's easy to convert base10 into base16 : > a : integer := 16#A#; > a := Integer'Value (Integer'Image(a)); -- result 10 > >But how can i convert from base10 to base16 or other ? I do not understand your problem: a : integer := 16#A#; -- a is now 10 a := Integer'Value ( -- this returns 10 Integer'Image (a) -- this returns " 10" ); Please specify your problem again. Are you looking for a function taking a STRING and returning an INTEGER assuming the string is hex? Integer'Value (Integer'Image(base) & '#' & input_string & '#')