Quantcast
Channel: MobileRead Forums
Viewing all articles
Browse latest Browse all 50080

Native bc - Command Line Calculator for Kindle!

$
0
0
Name: bc (Basic Calculator.. Bench Calculator)

Description: Command line based arbitrary precision calculator language, with syntax similar to C. Can be used as interactive shell or as scripting language.

History: Originally designed as a front end to dc (Desk Calculator) which used reverse polish notation.

Authors: Robert Morris and Lorinda Cherry (Unix version, 1975), Philip Nelson (GNU version, 1991)

Version: 1.06.95-9 (2014)

Library dependencies: libtinfo.so.5, libreadline.so.6

Works on: possibly all kindles. tested ok on pw1, pw3 and kt3.

Needs: Jailbroken Kindle with kterm installed

Features:
  • - Arithmetic operators
  • - Increment and decrement operators
  • - Assignment operators
  • - Comparision or Relational Operators
  • - Logical or Boolean operators
  • - Math Functions
  • - Conditional statements
  • - Iterative statements
  • - Functions

Instructions:
  • Unzip attached file bc-kual.zip into /mnt/us/extensions
  • Select bc from KUAL menu
  • In the kterm window enter bc as explained above
  • Try ./sier.sh to generate text mode sierpinski triangles

Usage:
  • - On the command line, like echo "1+2"|bc.
  • - Interactively, by entering bc first.. then 1+2. Exit by entering quit.
  • - By entering commands into a file.. then by entering bc < <filename>
  • - Also, scripts containing functions can be loaded as parameters and the functions defined in these scripts will then be available in interactive or CLI mode.
  • - There is a built-in library which is included by entering bc -l.
There is a detailed syntax using bases, scales, variables, operators, expressions, statements and functions.
See screenshots showing brief help and limits, pi calculated to 2000 places and a text mode Sierpinski fractal!
For more instructions and examples, see manual(inside zip) and links below.

Links:
Attachments:
  • - bc-kual.zip (executable, library files and sample scripts ready for loading into KUAL, user manual in text format)
  • - screenshots (brief help + limits, pi calculated to 2000 places, Text mode Sierpinski fractal)

Attached Thumbnails
Click image for larger version

Name:	bc-help-and-limits.png
Views:	N/A
Size:	31.4 KB
ID:	159225   Click image for larger version

Name:	pw1-pi-2000-places!.png
Views:	N/A
Size:	48.5 KB
ID:	159226   Click image for larger version

Name:	sierpinski.png
Views:	N/A
Size:	20.0 KB
ID:	159227  
Attached Files
File Type: zip bc-kual.zip (179.4 KB)

Viewing all articles
Browse latest Browse all 50080

Latest Images

Trending Articles



Latest Images