| 1 |
Require Import PrimFloat. |
| 2 |
|
| 3 |
Check 2%float. |
| 4 |
Check 2.5%float. |
| 5 |
Check (-2.5)%float. |
| 6 |
(* Avoid exponents with less than three digits as they are usually |
| 7 |
displayed with two digits (1e7 is displayed 1e+07) except on |
| 8 |
Windows where three digits are used (1e+007). *) |
| 9 |
Check 2.5e123%float. |
| 10 |
Check (-2.5e-123)%float. |
| 11 |
Check (2 + 2)%float. |
| 12 |
Check (2.5 + 2.5)%float. |
| 13 |
|
| 14 |
Open Scope float_scope. |
| 15 |
|
| 16 |
Check 2. |
| 17 |
Check 2.5. |
| 18 |
Check (-2.5). |
| 19 |
Check 2.5e123. |
| 20 |
Check (-2.5e-123). |
| 21 |
Check (2 + 2). |
| 22 |
Check (2.5 + 2.5). |
| 23 |
Check -0x1a. |
| 24 |
Check 0xb.2c. |
| 25 |
Check -0x1ae2. |
| 26 |
Check 0xb.2cp2. |
| 27 |
Check 0xb.2cp8. |
| 28 |
Check -0xb.2cp-2. |
| 29 |
|
| 30 |
Check 1e309. |
| 31 |
Check -1e309. |
| 32 |
|
| 33 |
Set Printing All. |
| 34 |
Check 0.5. |
| 35 |
Unset Printing All. |
| 36 |
Check 0.5. |
| 37 |
Unset Printing Float. |
| 38 |
Check 0.5. |
| 39 |
Set Printing Float. |
| 40 |
Check 0.5. |
| 41 |
|
| 42 |
Open Scope nat_scope. |
| 43 |
|
| 44 |
Check 2. |
| 45 |
Check 2%float. |
| 46 |
|
| 47 |
Delimit Scope float_scope with flt. |
| 48 |
Definition t := 2%float. |
| 49 |
Print t. |
| 50 |
Delimit Scope nat_scope with float. |
| 51 |
Print t. |
| 52 |
Check 2. |
| 53 |
Close Scope nat_scope. |
| 54 |
Check 2. |
| 55 |
Close Scope float_scope. |