12.07.2015 Views

page-1983-101-timex-sinclair-programming-tricks

page-1983-101-timex-sinclair-programming-tricks

page-1983-101-timex-sinclair-programming-tricks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

54 ReciprocalsKey in any number. The computer will display itsreciprocal. The actual conversion is done here at line 30.Program Listing10 LET R=JI20 PRINT •NUMBER TO CONVERT TO RECIPROCAL"25 INPUT N30 LET R=l/N35 CLS40 PRINT •THE RECIPROCAL OF •;N45 PRINT •Is •;R50 PRINT55 GOTO 1055 Dump the IntegerLook at the number 123.456 with an eye toward howto get rid of the portion left of the decimal point. Keeponly .456 and dump 123. Here's a short program tc accomplishthat.Try 5.67. It will come out .67. Or 500.5 which willcome out .5.Caution: your TIMEX is not always accurate at math.Try ,987.65, for example. It will result in .64999986because when the TIMEX subtracts 987 from 987.65 atline 30 it does not get .65 as the correct answer. Rather, itgets an approximate answer!Program Listing10 LET X=JI20 PRINT •GIVE ME ANY NUMBER"30 PRINT •wITH A DECIMAL"40 INPUT N50 LET X=N-INT N73

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!