From: lutz@iks-jena.de (Lutz Donnerhacke)
Subject: Re: convert integer base10 into base16
Date: Tue, 12 Feb 2002 12:10:50 +0000 (UTC)
Date: 2002-02-12T12:10:50+00:00 [thread overview]
Message-ID: <slrna6i1i8.ke.lutz@taranis.iks-jena.de> (raw)
In-Reply-To: 8fe5cfbb.0202120405.19690c26@posting.google.com
* 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 & '#')
next prev parent reply other threads:[~2002-02-12 12:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-12 12:05 convert integer base10 into base16 c-kif-kif
2002-02-12 12:10 ` Lutz Donnerhacke [this message]
2002-02-12 13:53 ` Alfred Hilscher
2002-02-12 14:33 ` Georg Bauhaus
2002-02-12 16:45 ` Stephen Leake
2002-02-13 6:17 ` Dale Stanbrough
2002-02-13 9:44 ` c-kif-kif
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox