Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
7
Task/Test-integerness/Tcl/test-integerness-1.tcl
Normal file
7
Task/Test-integerness/Tcl/test-integerness-1.tcl
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
proc isNumberIntegral {x} {
|
||||
expr {$x == entier($x)}
|
||||
}
|
||||
# test with various kinds of numbers:
|
||||
foreach x {1e100 3.14 7 1.000000000000001 1000000000000000000000 -22.7 -123.000} {
|
||||
puts [format "%s: %s" $x [expr {[isNumberIntegral $x] ? "yes" : "no"}]]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue