public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] OT: bash & decimal/exponential numbers math...
@ 2005-11-22 11:32 jarry
  2005-11-26 22:29 ` Anthony E. Caudel
  0 siblings, 1 reply; 2+ messages in thread
From: jarry @ 2005-11-22 11:32 UTC (permalink / raw
  To: gentoo-user

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 1082 bytes --]

Hi,

I wrote a short script for simple text file processing in bash
(using "<" for input redirection and "read"). I know, there are
probably better tools to do it, but the only thing I can rely on
being installed on target comp is really bash and nothing more
(no bc, sed, awk, etc.) so I must use only its built-in functions. 

Everything would be OK, if there were only positive integer numbers
in that input file. Unfortunatelly, there are also decimal and
exponential numbers (like 123.456 or 1.23456e+02) which my script
must process. Now I'm pretty deadlocked because too late I realised
that very basic math functions of bash can not handle such numbers.

Now what to do? Are there some functions, which would implement basic
math with real numbers in bash (add, substract, multiply, divide
and round would be enough)?
The idea of writing them myself really scares me...

Jarry

-- 
10 GB Mailbox, 100 FreeSMS/Monat http://www.gmx.net/de/go/topmail
+++ GMX - die erste Adresse für Mail, Message, More +++
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-11-26 22:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-22 11:32 [gentoo-user] OT: bash & decimal/exponential numbers math jarry
2005-11-26 22:29 ` Anthony E. Caudel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox