Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
10
Task/Test-integerness/Sidef/test-integerness.sidef
Normal file
10
Task/Test-integerness/Sidef/test-integerness.sidef
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
func is_int (n, tolerance=0) {
|
||||
!!(abs(n.real.round + n.imag - n) <= tolerance)
|
||||
}
|
||||
|
||||
%w(25.000000 24.999999 25.000100 -2.1e120 -5e-2 Inf NaN 5.0+0.0i 5-5i).each {|s|
|
||||
var n = Number(s)
|
||||
printf("%-10s %-8s %-5s\n", s,
|
||||
is_int(n),
|
||||
is_int(n, tolerance: 0.00001))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue