home *** CD-ROM | disk | FTP | other *** search
/ ticalc.org / ticalc_org_rev_b.iso / archives / 80 / basic / math / primef.80 < prev    next >
Encoding:
Text File  |  2001-07-01  |  718 b   |  30 lines

  1. Prime factors
  2. ----------------------------------------------------------------
  3. Version: 1.0, 971216
  4. Creators: Daniel Bergman, Mattias MorΘn, Peter Widmark.
  5. Description: Splits a number into its prime factors.
  6. Comments: "->" is the "STO>"-button, "\/" is the square root.
  7. Known bugs: None.
  8. Size: 90 bytes.
  9.  
  10. For more games and programs, please visit http://ti80.burtrask.net.
  11.  
  12. PROGRAM:PRIMF
  13. INPUT X
  14. IF X<=1:STOP
  15. LBL 1
  16. 2->A
  17. IF REMAINDER(X,2)=0:GOTO 2
  18. FOR(A,3,\/X+1,2
  19. IF REMAINDER(X,A)=0:GOTO 2
  20. END
  21. IF X<>1:DISP X
  22. STOP
  23. LBL 2
  24. DISP A
  25. X/A->X
  26. GOTO 1
  27.  
  28. --------------------------------------------------------------------
  29. Copyright (C) 1998 by Daniel Bergman & Mattias MorΘn
  30. http://ti80.burtrask.net