--- title: "Multiplication Precision in 4 digit blocks" id: 77470 type: "computer_media" slug: "multiplication-precision-in-4-digit-blocks" url: "http://localhost/computer_media/multiplication-precision-in-4-digit-blocks/" markdown_url: "http://localhost/computer_media/multiplication-precision-in-4-digit-blocks.md" published_at: "2026-11-15T18:38:25+00:00" modified_at: "2026-11-15T18:38:25+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/11/multiplication-precision-4-digit-blocks-1.png" excerpt: "Multiplies whole numbers of any length with full precision, working in blocks of four digits." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "LKDOS" slug: "lkdos" taxonomy: "post_tag" url: "http://localhost/tag/lkdos/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Steve Gunhouse" slug: "steve-gunhouse" taxonomy: "indiv" url: "http://localhost/indiv/steve-gunhouse/" genre: - name: "Mathematics" slug: "mathematics" taxonomy: "genre" url: "http://localhost/type/mathematics/" media_type: "Program" programmers: - name: "Steve Gunhouse" slug: "steve-gunhouse" taxonomy: "indiv" url: "http://localhost/indiv/steve-gunhouse/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Multiplication%20Precision%20in%204%20digit%20blocks%20%281991%29%28Gunhouse%2C%20Steven%20V.%29%28TS2068%29%28US%29%28Program%29.zip" tsrun_member: "Multiplication Precision in 4 digit blocks (1991)(Gunhouse, Steven V.)(TS2068)(US)(Program)/Multiplication Precision in 4 digit blocks (1991)(Gunhouse, Steven V.)(TS2068)(US)(Program).tap" mediadate: "1991" images: - url: "http://localhost/wp-content/uploads/2026/11/multiplication-precision-4-digit-blocks-1.png" article_media: - id: 23355 title: "Re: Multiplication programs from last month" type: "article" url: "http://localhost/article/re-multiplication-programs-from-last-month/" related_content: - id: 77503 title: "Russian Peasant Multiplication" type: "computer_media" url: "http://localhost/computer_media/russian-peasant-multiplication/" media_type_tags: "Mathematics" license: false --- # Multiplication Precision in 4 digit blocks Multiplies two whole numbers of any length with full precision. The numbers are typed as strings, split into blocks of four digits, multiplied block by block with carries, and the result is printed with each block padded to four digits. Working four digits at a time is much faster than the digit-by-digit “Multiplication Accuracy” program it answers. Answer Y to “Another Number?” to go again; the new result is printed over the old one. Line 9999 saves to a Larken disk and is not needed from tape. Published in Sinc-Link January-February 1991 ([Re: Multiplication programs from last month](https://timexsinclair.com/article/re-multiplication-programs-from-last-month/)). ## Source Code ``` 5 REM Multiplication Precision in 4 digit blocks 7 PRINT AT 1,3;"Precision Multiplication"'' 8 PRINT TAB 6;"by Steven Gunhouse" 10 INPUT "First Number?"'a$ 15 LET a$=" "+a$ 16 REM the extra spaces are necessary in case there would be <4 digits in the first block 20 INPUT "Second Number?"'b$ 25 LET b$=" "+b$ 30 LET a=INT (LEN a$/4) 35 LET b=INT (LEN b$/4) 40 DIM a(a) 45 DIM b(b) 50 FOR i=LEN a$ TO 4 STEP -4 55 LET a(INT (i/4))=VAL a$(i-3 TO i) 60 NEXT i 70 FOR i=LEN b$ TO 4 STEP -4 75 LET b(INT (i/4))=VAL b$(i-3 TO i) 80 NEXT i 90 DIM c(a+b) 100 FOR i=a TO 1 STEP -1 105 LET t1=0 110 FOR j=b TO 1 STEP -1 115 LET c(i+j)=t1+c(i+j)+a(i)*b(j) 120 LET t1=INT (c(i+j)/1e4) 125 LET c(i+j)=c(i+j)-t1*1e4 130 NEXT j 140 LET c(i)=t1 150 NEXT i 200 PRINT a$(4 TO );"x";b$(4 TO );"=" 205 LET i=1 210 IF c(1)=0 THEN LET i=2 215 PRINT c(i); 220 FOR j=i+1 TO a+b 225 LET t$=STR$ c(j) 230 PRINT ("000"+t$)(LEN t$ TO ); 235 REM Must add extra zeros if t$ is too small (<1000) 240 NEXT j 250 PRINT '"Done." 990 INPUT "Another Number? ";y$: IF y$="Y" OR y$="y" THEN GO TO 1 999 STOP 9999 RANDOMIZE USR 100: SAVE "mult.B4" LINE 1 ```