File: Test004.ML

package info (click to toggle)
polyml 5.7.1-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 40,616 kB
  • sloc: cpp: 44,142; ansic: 26,963; sh: 22,002; asm: 13,486; makefile: 602; exp: 525; python: 253; awk: 91
file content (10 lines) | stat: -rw-r--r-- 517 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
(* Check some word operations.  These probably won't be checked
   elsewhere because we're converting from arbitrary precision. *)
fun verify true = ()
|   verify false = raise Fail "wrong";

(* These assume 31 bit arithmetic.  TODO: Add tests for 63-bits. *)
verify(Word.wordSize <> 31 orelse Word.fromLargeInt 10000000000 = 0wx540BE400);
verify(Word.wordSize <> 31 orelse Word.fromLargeInt ~10000000000 = 0wx2BF41C00);
verify(Word.fromInt 1 = 0w1);
verify(Word.wordSize <> 31 orelse Word.fromInt ~1 = 0wx7FFFFFFF);