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,26 +0,0 @@
with Ada.Text_IO;
procedure Currency is
type Dollar is delta 0.01 range 0.0 .. 24_000_000_000_000_000.0;
package Dollar_IO is new Ada.Text_IO.Fixed_IO(Dollar);
hamburger_cost : constant := 5.50;
milkshake_cost : constant := 2.86;
tax_rate : constant := 0.0765;
total_cost : constant := hamburger_cost * 4_000_000_000_000_000.0 + milkshake_cost * 2;
total_tax : constant := total_cost * tax_rate;
total_with_tax : constant := total_cost + total_tax;
begin
Ada.Text_IO.Put("Price before tax:");
Dollar_IO.Put(total_cost);
Ada.Text_IO.New_Line;
Ada.Text_IO.Put("Tax: ");
Dollar_IO.Put(total_tax);
Ada.Text_IO.New_Line;
Ada.Text_IO.Put("Total: ");
Dollar_IO.Put(total_with_tax);
Ada.Text_IO.New_Line;
end Currency;

View file

@ -1,28 +0,0 @@
>>SOURCE FREE
IDENTIFICATION DIVISION.
PROGRAM-ID. currency-example.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 Burger-Price CONSTANT 5.50.
01 Milkshake-Price CONSTANT 2.86.
01 num-burgers PIC 9(18) VALUE 4000000000000000.
01 num-milkshakes PIC 9(18) VALUE 2.
01 tax PIC 9(18)V99.
01 tax-edited PIC $(17)9.99.
01 Tax-Rate CONSTANT 7.65.
01 total PIC 9(18)V99.
01 total-edited PIC $(17)9.99.
PROCEDURE DIVISION.
COMPUTE total rounded, total-edited rounded =
num-burgers * Burger-Price + num-milkshakes * Milkshake-Price
DISPLAY "Total before tax: " total-edited
COMPUTE tax rounded, tax-edited rounded = total * (Tax-Rate / 100)
DISPLAY " Tax: " tax-edited
ADD tax TO total GIVING total-edited rounded
DISPLAY " Total with tax: " total-edited
.
END PROGRAM currency-example.

View file

@ -16,13 +16,10 @@ func[] bnmul a[] b[] .
.
func[] bnadd a[] b[] .
if len a[] < len b[] : swap a[] b[]
for i = 1 to len b[]
h = a[i] + b[i] + c
r[] &= h mod 10000000
c = h div 10000000
.
for i = len b[] + 1 to len a[]
h = a[i] + c
for i = 1 to len a[]
bi = 0
if i <= len b[] : bi = b[i]
h = a[i] + bi + c
r[] &= h mod 10000000
c = h div 10000000
.