ChipMaster's bwBASIC This also includes history going back to v2.10. *WARN* some binary files might have been corrupted by CRLF.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

43 lines
851 B

  1. 10 REM REPRESENTING A DECIMAL
  2. 12 REM VALUE BY A CONTINUED
  3. 14 REM FRACTION
  4. 16 REM
  5. 18 ' DEFDBL A-H,K-Z
  6. 20 ' DEFINT I,J
  7. 22 C1=1: O=99999
  8. 24 O1$="##### ########## /"
  9. 26 O2$="= ##.#############"
  10. 28 REM
  11. 30 P=1E12
  12. 32 DIM F(100)
  13. 34 INPUT "DECIMAL VALUE";K
  14. 36 PRINT
  15. 38 I=-1
  16. 40 I=I+1
  17. 42 F(I)=INT(K): IF I>=1 THEN 46
  18. 44 N=F(I): D=1: GOTO 48
  19. 46 GOSUB 68
  20. 48 R=N/D
  21. 50 IF ABS(N)>P THEN 66
  22. 52 IF ABS(D)>P THEN 66
  23. 54 PRINT USING O1$;F(I);N;
  24. 56 PRINT D;TAB(30);
  25. 58 PRINT USING O2$;R
  26. 60 K1=K-INT(K): IF K1=0 THEN 66
  27. 62 IF ABS(R-O)<1/P THEN 66
  28. 64 K=C1/K1: O=R: GOTO 40
  29. 66 END
  30. 68 D=F(I): N=1
  31. 70 FOR J=I-1 TO 0 STEP -1
  32. 72 N1=D
  33. 74 D1=F(J)*D+N
  34. 76 N=N1: D=D1
  35. 78 NEXT J
  36. 80 N=D1: D=N1
  37. 82 RETURN
  38. 100 REM ************************
  39. 110 REM FROM SKY & TELESCOPE'S
  40. 120 REM ASTRONOMICAL COMPUTING
  41. 130 REM FOR JANUARY, 1989
  42. 140 REM ************************