June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
1
Task/Zero-to-the-zero-power/Dc/zero-to-the-zero-power.dc
Normal file
1
Task/Zero-to-the-zero-power/Dc/zero-to-the-zero-power.dc
Normal file
|
|
@ -0,0 +1 @@
|
|||
0 0^p
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
/* created by Aykayayciti Earl Lamont Montgomery
|
||||
April 9th, 2018 */
|
||||
|
||||
x = 0
|
||||
y = 0
|
||||
z = x**y
|
||||
> "z=", z
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
F64 a = 0 ` 0;
|
||||
Print("0 ` 0 = %5.3f\n", a);
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
> 0**0
|
||||
1
|
||||
|
|
@ -1,9 +1,7 @@
|
|||
zs = Any[zero(Complex),
|
||||
zero(FloatingPoint),
|
||||
zero(Rational),
|
||||
zero(Integer),
|
||||
zero(Bool)]
|
||||
const types = (Complex, Float64, Rational, Int, Bool)
|
||||
|
||||
for i in zs, j in zs
|
||||
println(i, "^", j, " = ", i^j, " (", typeof(i^j), ")")
|
||||
for Tb in types, Te in types
|
||||
zb, ze = zero(Tb), zero(Te)
|
||||
r = zb ^ ze
|
||||
@printf("%10s ^ %-10s = %7s ^ %-7s = %-12s (%s)\n", Tb, Te, zb, ze, r, typeof(r))
|
||||
end
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
from decimal import Decimal
|
||||
from fractions import Fraction
|
||||
from itertools import product
|
||||
|
||||
zeroes = [0, 0.0, 0j, Decimal(0), Fraction(0, 1), -0.0, -0.0j, Decimal(-0.0)]
|
||||
for i, j in product(zeroes, repeat=2):
|
||||
try:
|
||||
ans = i**j
|
||||
except:
|
||||
ans = '<Exception raised>'
|
||||
print(f'{i!r:>15} ** {j!r:<15} = {ans!r}')
|
||||
Loading…
Add table
Add a link
Reference in a new issue