Skip to content

Simple reverse polish notation calculator in FORTRAN

License

Notifications You must be signed in to change notification settings

jake-87/fortran-calc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fortran-calc

simple reverse poland calculator in fortran.

Please note that stringmod.f90 and precmod.f90 are not my own work. Unfortunatly, I have lost the source for these files.

How to build:

  • Clone latest source with git clone https://github.com/jake-87/fortran-calc or stable source with git clone https://github.com/jake-87/fortran-calc/tree/stable
  • Run bmake in top directory, which will output an executable named fcalc.

Requirements:

  • gfortran
  • bmake

avalible operators:

  • +
  • -
  • *
  • /
  • .sin
  • .cos
  • .tan
  • ^ Self Explanitory
  • #
  • ^ Inverse square, works the same as a square root
  • .rsin
  • .rcos
  • .rtan
  • ^ Same as sin, cos, tan but with radians instead of degrees.
  • .asin
  • .acos
  • .atan
  • ^ Arc versions of sin, cos, tan.
  • .rasin
  • .racos
  • .ratan
  • ^ Same as arcsin, cos, tan but in radians.
  • .loge
  • .log10
  • .log
  • ^ Calculates logs. The .log command works like this: 2 8 log, calculating log 2 (8).
  • .pi
  • .tau
  • .gr (Golden Ratio)
  • .e
  • ^ Pushes the corresponding irrational number onto the stack.

avalible commands:

  • p
  • Print current top of stack
  • r
  • Reset stack
  • pop
  • Remove top of stack
  • pp
  • Print current pointer to top of stack
  • q
  • Quits
  • help
  • Prints help message.