Version française
Home     About     Download     Resources     Contact us    
Browse thread
Unsigned int ?!
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Xavier Leroy <Xavier.Leroy@i...>
Subject: Re: Unsigned int ?!
> I would like to get the "caml unsigned int value" of an "unsigned int C
> value". Is there a way to do this ??
> I do the following, and it fails ...

I tried to reproduce the problem from your (incomplete) code snippet,
and everything worked fine.  If you have a complete (self-contained)
program that reproduces the problem, please send it to
caml-bugs@inria.fr.

As for the unsigned vs. signed issue, it's just two ways to view the
same bit patterns: the most significant bit of the unsigned int becomes
the sign bit of the signed int.  So, for "small enough" unsigned ints,
you will see them as the corresponding Caml int; large unsigned ints
wrap around.

- Xavier Leroy