MAJ litteraux entiers

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6588 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Xavier Leroy 2004-08-12 12:59:29 +00:00
parent 3b97dfba7d
commit 4ab9fff604
1 changed files with 15 additions and 16 deletions

View File

@ -159,10 +159,10 @@ struct
3, -123, 1;
4, 123, -1;
5, -123, -1;
6, 1275312364, 365;
6, 127531236, 365;
7, 16384, 256;
8, -1275312364, 365;
9, 1275312364, -365;
8, -127531236, 365;
9, 127531236, -365;
10, 1234567, 12345678;
11, 1234567, -12345678];
@ -174,10 +174,10 @@ struct
3, -123, 1;
4, 123, -1;
5, -123, -1;
6, 1275312364, 365;
6, 127531236, 365;
7, 16384, 256;
8, -1275312364, 365;
9, 1275312364, -365;
8, -127531236, 365;
9, 127531236, -365;
10, 1234567, 12345678;
11, 1234567, -12345678];
@ -391,10 +391,10 @@ struct
3, -123, 1;
4, 123, -1;
5, -123, -1;
6, 1275312364, 365;
6, 127531236, 365;
7, 16384, 256;
8, -1275312364, 365;
9, 1275312364, -365;
8, -127531236, 365;
9, 127531236, -365;
10, 1234567, 12345678;
11, 1234567, -12345678];
@ -406,10 +406,10 @@ struct
3, -123, 1;
4, 123, -1;
5, -123, -1;
6, 1275312364, 365;
6, 127531236, 365;
7, 16384, 256;
8, -1275312364, 365;
9, 1275312364, -365;
8, -127531236, 365;
9, 127531236, -365;
10, 1234567, 12345678;
11, 1234567, -12345678];
@ -538,6 +538,7 @@ let _ =
(Nativeint.of_string "0x12345678");
test 2 (Nativeint.to_int32 (Nativeint.of_string "0x12345678"))
(Int32.of_string "0x12345678");
if Sys.word_size = 64 then
test 3 (Nativeint.to_int32 (Nativeint.of_string "0x123456789ABCDEF0"))
(Int32.of_string "0x9ABCDEF0");
testing_function "int64 of/to int32";
@ -553,11 +554,9 @@ let _ =
test 2 (Int64.to_nativeint (Int64.of_string "-0x12345678"))
(Nativeint.of_string "-0x12345678");
test 3 (Int64.to_nativeint (Int64.of_string "0x123456789ABCDEF0"))
(Nativeint.of_string "0x123456789ABCDEF0");
test 4 (Int64.of_nativeint (Nativeint.of_string "0x9ABCDEF012345678"))
(if Sys.word_size = 64
then Int64.of_string "0x9ABCDEF012345678"
else Int64.of_string "0x12345678")
then Nativeint.of_string "0x123456789ABCDEF0"
else Nativeint.of_string "0x9ABCDEF0")
(********* End of test *********)