File: NumbersSyntax.v

package info (click to toggle)
coq-doc 8.3pl4-1
  • links: PTS, VCS
  • area: non-free
  • in suites: wheezy
  • size: 20,504 kB
  • sloc: ml: 134,418; lisp: 2,734; ansic: 1,968; sh: 1,204; makefile: 611
file content (50 lines) | stat: -rw-r--r-- 1,351 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

Require Import BigQ.

Open Scope int31_scope.
Check I31. (* Would be nice to have I31 : digits->digits->...->int31
              For the moment, I31 : digits31 int31, which is better
	      than (fix nfun .....) size int31 *)
Check 2.
Check 1000000000000000000. (* = 660865024, after modulo 2^31 *)
Check (add31 2 2).
Check (2+2).
Eval vm_compute in 2+2.
Eval vm_compute in 65675757 * 565675998.
Close Scope int31_scope.

Open Scope bigN_scope.
Check 2.
Check 1000000000000000000.
Check (BigN.add 2 2).
Check (2+2).
Eval vm_compute in 2+2.
Eval vm_compute in 65675757 * 565675998.
Eval vm_compute in 2^100.
Close Scope bigN_scope.

Open Scope bigZ_scope.
Check 2.
Check -1000000000000000000.
Check (BigZ.add 2 2).
Check (2+2).
Eval vm_compute in 2+2.
Eval vm_compute in 65675757 * 565675998.
Eval vm_compute in (-2)^100.
Close Scope bigZ_scope.

Open Scope bigQ_scope.
Check 2.
Check -1000000000000000000.
Check (BigQ.add 2 2).
Check (2+2).
Eval vm_compute in 2+2.
Eval vm_compute in 65675757 * 565675998.
(* fractions *)
Check (6562 # 456). (* Nota: # is BigQ.Qq i.e. base fractions *)
Eval vm_compute in (BigQ.red (6562 # 456)).
Eval vm_compute in (1/-10000).
Eval vm_compute in (BigQ.red (1/(1/100))). (* back to integers... *)
Eval vm_compute in ((2/3)^(-100)).
Eval vm_compute in BigQ.red ((2/3)^(-1000) * (2/3)^(1000)).
Close Scope bigQ_scope.