Data update

This commit is contained in:
Ingy döt Net 2026-02-01 16:33:20 -08:00
parent 5150844a7d
commit 4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions

View file

@ -1,7 +0,0 @@
with Ada.Text_Io;
procedure CompileTimeCalculation is
Factorial : constant Integer := 10*9*8*7*6*5*4*3*2*1;
begin
Ada.Text_Io.Put(Integer'Image(Factorial));
end CompileTimeCalculation;

View file

@ -1,16 +0,0 @@
with Ada.Text_Io;
procedure CompileTimeCalculation is
function Factorial (Int : in Integer) return Integer is
begin
if Int > 1 then
return Int * Factorial(Int-1);
else
return 1;
end if;
end;
Fact10 : Integer := Factorial(10);
begin
Ada.Text_Io.Put(Integer'Image(Fact10));
end CompileTimeCalculation;

View file

@ -1,12 +0,0 @@
with Ada.Text_IO;
procedure Unbounded_Compile_Time_Calculation is
F_10 : constant Integer := 10*9*8*7*6*5*4*3*2*1;
A_11_15 : constant Integer := 15*14*13*12*11;
A_16_20 : constant Integer := 20*19*18*17*16;
begin
Ada.Text_IO.Put_Line -- prints out
("20 choose 10 =" & Integer'Image((A_11_15 * A_16_20 * F_10) / (F_10 * F_10)));
-- Ada.Text_IO.Put_Line -- would not compile
-- ("Factorial(20) =" & Integer'Image(A_11_15 * A_16_20 * F_10));
end Unbounded_Compile_Time_Calculation;

View file

@ -1,2 +0,0 @@
Ada.Text_IO.Put_Line -- would not compile
("Factorial(20) =" & Integer'Image(A_11_15 * A_16_20 * F_10));

View file

@ -1,6 +1,3 @@
(phixonline)-->
<span style="color: #004080;">integer</span> <span style="color: #000000;">a</span><span style="color: #0000FF;">,</span><span style="color: #000000;">b</span>
<span style="color: #000000;">a</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">10</span><span style="color: #0000FF;">*</span><span style="color: #000000;">9</span><span style="color: #0000FF;">*</span><span style="color: #000000;">8</span><span style="color: #0000FF;">*</span><span style="color: #000000;">7</span><span style="color: #0000FF;">*</span><span style="color: #000000;">6</span><span style="color: #0000FF;">*</span><span style="color: #000000;">5</span><span style="color: #0000FF;">*</span><span style="color: #000000;">4</span><span style="color: #0000FF;">*</span><span style="color: #000000;">3</span><span style="color: #0000FF;">*</span><span style="color: #000000;">2</span><span style="color: #0000FF;">*</span><span style="color: #000000;">1</span>
<span style="color: #000000;">b</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">factorial</span><span style="color: #0000FF;">(</span><span style="color: #000000;">10</span><span style="color: #0000FF;">)</span>
<span style="color: #0000FF;">?{</span><span style="color: #000000;">a</span><span style="color: #0000FF;">,</span><span style="color: #000000;">b</span><span style="color: #0000FF;">}</span>
<!--
integer a = 10*9*8*7*6*5*4*3*2*1,
b = factorial(10)
?{a,b}

View file

@ -1,14 +0,0 @@
function fact([BigInt]$n){
if($n -ge ([BigInt]::Zero)) {
$fact = [BigInt]::One
([BigInt]::One)..$n | foreach{
$fact = [BigInt]::Multiply($fact, $_)
}
$fact
} else {
Write-Error "$n is lower than 0"
}
}
"$((Measure-Command {$fact = fact 10}).TotalSeconds) Seconds"
$fact