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,31 +0,0 @@
type Price is delta 0.01 digits 3 range 0.0..1.0;
function Scale (Value : Price) return Price is
X : constant array (1..19) of Price :=
( 0.06, 0.11, 0.16, 0.21, 0.26, 0.31, 0.36, 0.41, 0.46, 0.51,
0.56, 0.61, 0.66, 0.71, 0.76, 0.81, 0.86, 0.91, 0.96
);
Y : constant array (1..20) of Price :=
( 0.10, 0.18, 0.26, 0.32, 0.38, 0.44, 0.50, 0.54, 0.58, 0.62,
0.66, 0.70, 0.74, 0.78, 0.82, 0.86, 0.90, 0.94, 0.98, 1.0
);
Low : Natural := X'First;
High : Natural := X'Last;
Middle : Natural;
begin
loop
Middle := (Low + High) / 2;
if Value = X (Middle) then
return Y (Middle + 1);
elsif Value < X (Middle) then
if Low = Middle then
return Y (Low);
end if;
High := Middle - 1;
else
if High = Middle then
return Y (High + 1);
end if;
Low := Middle + 1;
end if;
end loop;
end Scale;

View file

@ -1,11 +0,0 @@
with Ada.Text_IO; use Ada.Text_IO;
procedure Test_Price_Fraction is
-- Put the declarations here
Value : Price := Price'First;
begin
loop
Put_Line (Price'Image (Value) & "->" & Price'Image (Scale (Value)));
exit when Value = Price'Last;
Value := Price'Succ (Value);
end loop;
end Test_Price_Fraction;

View file

@ -1,20 +0,0 @@
constant table = {
{0.06, 0.10}, {0.11, 0.18}, {0.16, 0.26}, {0.21, 0.32},
{0.26, 0.38}, {0.31, 0.44}, {0.36, 0.50}, {0.41, 0.54},
{0.46, 0.58}, {0.51, 0.62}, {0.56, 0.66}, {0.61, 0.70},
{0.66, 0.74}, {0.71, 0.78}, {0.76, 0.82}, {0.81, 0.86},
{0.86, 0.90}, {0.91, 0.94}, {0.96, 0.98}, {1.01, 1.00}
}
function price_fix(atom x)
for i = 1 to length(table) do
if x < table[i][1] then
return table[i][2]
end if
end for
return -1
end function
for i = 0 to 99 do
printf(1, "%.2f %.2f\n", { i/100, price_fix(i/100) })
end for

View file

@ -1,45 +0,0 @@
function Convert-PriceFraction
{
[CmdletBinding()]
[OutputType([double])]
Param
(
[Parameter(Mandatory=$true,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true,
Position=0)]
[ValidateScript({$_ -ge 0.0 -and $_ -le 1.0})]
[double]
$InputObject
)
Process
{
foreach ($fraction in $InputObject)
{
switch ($fraction)
{
{$_ -lt 0.06} {0.10; break}
{$_ -lt 0.11} {0.18; break}
{$_ -lt 0.16} {0.26; break}
{$_ -lt 0.21} {0.32; break}
{$_ -lt 0.26} {0.38; break}
{$_ -lt 0.31} {0.44; break}
{$_ -lt 0.36} {0.50; break}
{$_ -lt 0.41} {0.54; break}
{$_ -lt 0.46} {0.58; break}
{$_ -lt 0.51} {0.62; break}
{$_ -lt 0.56} {0.66; break}
{$_ -lt 0.61} {0.70; break}
{$_ -lt 0.66} {0.74; break}
{$_ -lt 0.71} {0.78; break}
{$_ -lt 0.76} {0.82; break}
{$_ -lt 0.81} {0.86; break}
{$_ -lt 0.86} {0.90; break}
{$_ -lt 0.91} {0.94; break}
{$_ -lt 0.96} {0.98; break}
Default {1.00}
}
}
}
}

View file

@ -1 +0,0 @@
.7388727, .8593103, .826687, .3444635, .0491907 | Convert-PriceFraction | ForEach-Object {"{0:C}" -f $_}

View file

@ -1,48 +0,0 @@
Function pf(p)
If p < 0.06 Then
pf = 0.10
ElseIf p < 0.11 Then
pf = 0.18
ElseIf p < 0.16 Then
pf = 0.26
ElseIf p < 0.21 Then
pf = 0.32
ElseIf p < 0.26 Then
pf = 0.38
ElseIf p < 0.31 Then
pf = 0.44
ElseIf p < 0.36 Then
pf = 0.50
ElseIf p < 0.41 Then
pf = 0.54
ElseIf p < 0.46 Then
pf = 0.58
ElseIf p < 0.51 Then
pf = 0.62
ElseIf p < 0.56 Then
pf = 0.66
ElseIf p < 0.61 Then
pf = 0.70
ElseIf p < 0.66 Then
pf = 0.74
ElseIf p < 0.71 Then
pf = 0.78
ElseIf p < 0.76 Then
pf = 0.82
ElseIf p < 0.81 Then
pf = 0.86
ElseIf p < 0.86 Then
pf = 0.90
ElseIf p < 0.91 Then
pf = 0.94
ElseIf p < 0.96 Then
pf = 0.98
Else
pf = 1.00
End If
End Function
WScript.Echo pf(0.7388727)
WScript.Echo pf(0.8593103)
WScript.Echo pf(0.826687)
WScript.Echo pf(0.3444635)