caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Stalkern 2 <stalkern2@tin.it>
To: caml-list@inria.fr
Subject: Re: [Caml-list] How do I convert 0x hexadecimal integers to decimal integers ?
Date: Thu, 27 Mar 2003 18:54:55 +0100	[thread overview]
Message-ID: <200303271854.55964.stalkern2@tin.it> (raw)
In-Reply-To: <200303271820.34803.stalkern2@tin.it>

Il  Thursday 27 March 2003 18:20, Stalkern 2 ha scritto:
> Hello to everybody
> I'd  need a function to turn hexadecimal integers like
> 	0xb8f99c
> ( a Color in hexadecimal notation) to integer 3ples (e.g. `RGB
> (184*256,249*256,156*256), always a color).
>
> Shall I use Scanf functions and then some function converting hexadecimal
> numbers to decimal? what would this function be?

Well I see that I can also use String.sub but my problem would still be to 
convert a hexadecimal integer like 0xb8f99c into a string like "0xb8f99c", 
avoiding things like 
	# string_of_int 0xffffff;;
 	- : string = "16777215"
because in this case I don't know how to recognize the 3 integers that are 
side by side... are they side by side because of a convention or is there a 
way to convert "16777215" into the triple that I'm looking for?

T I A 
Ernesto

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2003-03-27 17:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-27 17:20 Stalkern 2
2003-03-27 17:54 ` Stalkern 2 [this message]
2003-03-27 17:58   ` Jun Furuse
2003-03-27 18:24   ` Brian Hurt
     [not found]   ` <002701c2f48a$555fa170$0201a8c0@mordor>
2003-03-27 18:42     ` Stalkern 2

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200303271854.55964.stalkern2@tin.it \
    --to=stalkern2@tin.it \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).