Giter Site home page Giter Site logo

foggynight / falc Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 33 KB

Stack-based postfix calculator at the command line.

License: GNU General Public License v3.0

Makefile 3.30% C 94.30% Shell 2.40%
c rpn stack-machine calculator forth postfix stack-based stack-calculator

falc's Introduction

falc

Stack-based postfix calculator.

All numbers are doubles, there's a variety of built-in mathematical functions, and the calculator contains a dictionary allowing values to stored and fetched using single letter variable names.

Installation

Build the falc executable:

make

Optional: Copy falc into a directory on the PATH:

cp falc /usr/local/bin

Usage

falc

This calculator operates by storing and fetching arguments from a data stack. When you enter a number, it is pushed onto the stack. When you enter the name of an operation, its arguments are popped off the stack, the operation is executed, and its return value is pushed onto the stack.

In addition to some mathematical functions, falc has various operations for manipulating the data stack, such as:

  • drop: Drop the top element of the data stack.
  • clear: Drop all elements of the data stack.

There is also an operation which allows values to be bound to single letter variable names: store, which stores the value in the dictionary under the key of the single letter word which follows store.

42 store x

The stored value may be retrieved by executing x, which looks up the value stored in the dictionary under the x key and pushes it onto the data stack.

License

Copyright (C) 2022 Robert Coffey

This is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3.

falc's People

Contributors

foggynight avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.