comp.lang.ada
 help / color / mirror / Atom feed
From: Dale Stanbrough <dale@cs.rmit.edu.au>
Subject: Re: convert integer base10 into base16
Date: Wed, 13 Feb 2002 17:17:49 +1100
Date: 2002-02-13T17:17:49+11:00	[thread overview]
Message-ID: <dale-379894.17174813022002@its-aw-news.its.rmit.edu.au> (raw)
In-Reply-To: 8fe5cfbb.0202120405.19690c26@posting.google.com

 c-kif-kif@eudoramail.com (c-kif-kif) wrote:

> I'm shure this question has been answered a million times, 
> but i still can't get it right.
> 
> 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 don't want to write it on screen, so i think it's not with put/get how it 
> works.


If you are concerned about how it is stored inside the computer
you don't need to worry. The number 16#A# is the same number as 10,
and is stored in binary format inside the computer (it is converted
to a binary format by the compiler, or by the assembler). 

It is only when it is being displayed that it is changed from
binary to whatever base you want.

Dale



  parent reply	other threads:[~2002-02-13  6:17 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
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 [this message]
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