Oracle DBA – A lifelong learning experience

Posts Tagged ‘unix’

Performing calculations in unix

Posted by John Hallas on August 31, 2009

Normally if I working on a database and want perform simple calculations I use the Oracle database rather than starting up the windows calculator.

select 6*1024*1024 from dual;



However I recently found out a method of using unix itself (I am sure there are many more options other than this one but I find this quite easy)

man bc gives

bc is an interactive processor for a language that resembles C but provides unlimited-precision arithmetic.  It takes input from any  files given, then reads the standard input.

In usage

/home/oracle $bc

Arithmetic operators are shown in the normal manner + – * / % ^ and there are lots of functions available such as sine, cosine and log, although I would be likely to use a calculator if I wanted to use these.

Posted in Oracle | Tagged: , , , , | 6 Comments »


Get every new post delivered to your Inbox.

Join 287 other followers