Jump to content

Programming calculator needed


Guest iwra
 Share

Recommended Posts

Guest iwra

What application is capable of performing simple calculations in programming?

 

Lets say this is the problem: 1 + 2 - ( 3 * 4 ) / 5 =

 

It will be smart enough to do the ones in bracks first just like in proper math, then calculate the others accordingly.

Edited by iwra
Link to comment
Share on other sites

There's a calculator in Mandriva's urpmi database called simply "Calculator" if I remember correctly. It is my current prefered calculator on computer.

 

It is a text-mode calculator where you type your line and you get the answer, and you can copy-paste as you want. Eg:

 

1+2-3*4/5
2.6

10*2.6
26

Simple as that!

 

You can of course make a launcher for it, something like:

xterm -t Calculator -geometry 40x80 -e calculator

 

Yves.

Link to comment
Share on other sites

I'm home now :) The launcher command is

rxvt -T Calculator -geometry 25x25 -e /usr/local/bin/textcalc

, /usr/local/bin/textcalc (I wrote it) is

#!/bin/bash
while read line; do calc -s "$line"; done

, and calc is in this rpm:

 

calculate-1.00-9mdk

 

Yves.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...