--- title: "POWER-root" id: 79497 type: "computer_media" slug: "power-root" url: "http://localhost/computer_media/power-root/" markdown_url: "http://localhost/computer_media/power-root.md" published_at: "2026-11-22T14:40:53+00:00" modified_at: "2026-11-22T14:40:53+00:00" featured_image: url: "http://localhost/wp-content/uploads/2026/11/power-root-1.png" excerpt: "Powers and roots, negative numbers included, on the TS2068." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - 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: "Stan Livingston" slug: "stan-livingston" taxonomy: "indiv" url: "http://localhost/indiv/stan-livingston/" genre: - name: "Mathematics" slug: "mathematics" taxonomy: "genre" url: "http://localhost/type/mathematics/" media_type: "Program" programmers: - name: "Stan Livingston" slug: "stan-livingston" taxonomy: "indiv" url: "http://localhost/indiv/stan-livingston/" download_url: "https://archive.org/download/timex-sinclair-software-archive/POWER-root%20%281985%29%28Livingston%2C%20Stanley%20W.%29%28TS2068%29%28Program%29.zip" tsrun_member: "POWER-root (1985)(Livingston, Stanley W.)(TS2068)(Program)/POWER-root (1985)(Livingston, Stanley W.)(TS2068)(Program).tap" mediadate: "1985" images: - url: "http://localhost/wp-content/uploads/2026/11/power-root-1.png" - url: "http://localhost/wp-content/uploads/2026/11/power-root-2.png" - url: "http://localhost/wp-content/uploads/2026/11/power-root-3.png" article_media: - id: 78323 title: "POWER-root" type: "article" url: "http://localhost/article/power-root-2/" - id: 45953 title: "Power-Root" type: "article" url: "http://localhost/article/power-root/" media_type_tags: "Mathematics" license: false --- # POWER-root Works out a power or a root of a number, including odd powers and odd roots of negative numbers, and reports an illegal argument for an even root of a negative number. RUN it, enter the number, type p for a power or r for a root (lower case), then enter the power or the root. Fractional powers of negative numbers are not real numbers; the program prints a value for them anyway. Published in LISTing October 1985 ([POWER-root](https://timexsinclair.com/article/power-root-2/)), and printed again in [June-August 1989](https://timexsinclair.com/article/power-root/). ## Source Code ``` 10 REM POWER-root 20 LET c=1 30 INPUT "INPUT ARGUMENT ";a 40 LET h=a 50 INPUT "POWER OR root? ";b$ 60 IF b$="p" THEN LET b$="POWER " 70 INPUT "VALUE OF POWER OR root ";d 80 LET g=d 90 LET e=ABS d 100 LET f=INT e 110 IF a<0 AND b$="r" AND (f/2)=INT (f/2) THEN PRINT "ILLEGAL ARGUMENT": STOP 120 IF b$="r" THEN LET d=1/d 130 IF b$="r" THEN LET b$="root " 140 IF h<0 AND (f/2)<>(INT (f/2)) THEN LET c=-1 150 LET a=ABS a 160 PRINT g;" "; b$;h;" = ";a↑d*c ```