Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
6
Task/Infinity/Tcl/infinity-1.tcl
Normal file
6
Task/Infinity/Tcl/infinity-1.tcl
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
package require Tcl 8.5
|
||||
|
||||
expr {1.0 / 0} ;# ==> Inf
|
||||
expr {-1.0 / 0} ;# ==> -Inf
|
||||
expr {inf} ;# ==> Inf
|
||||
expr {1 / 0} ;# ==> "divide by zero" error; Inf not part of range of integer division
|
||||
11
Task/Infinity/Tcl/infinity-2.tcl
Normal file
11
Task/Infinity/Tcl/infinity-2.tcl
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
% format %lx -1 ;# all bits set
|
||||
ffffffffffffffff
|
||||
|
||||
% regsub f 0x[format %lx -1] 7 ;# unset the sign bit for positive
|
||||
0x7fffffffffffffff
|
||||
|
||||
% set ii [expr [regsub f 0x[format %lx -1] 7]] ;# show as decimal
|
||||
9223372036854775807
|
||||
|
||||
% incr ii
|
||||
9223372036854775808 ;# silently upgrade to unbounded integer, still positive
|
||||
Loading…
Add table
Add a link
Reference in a new issue