home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.aix
- Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!darwin.sura.net!convex!constellation!geohub.gcn.uoknor.edu!dwight
- From: dwight@geohub.gcn.uoknor.edu (Dwight D. Moore)
- Subject: Re: Kornshell Arithmetic
- Originator: usenet@midway.ecn.uoknor.edu
- Sender: usenet@constellation.ecn.uoknor.edu (Usenet Administrator)
- Message-ID: <1992Sep10.142147.24140@constellation.ecn.uoknor.edu>
- Date: Thu, 10 Sep 1992 14:21:47 GMT
- Reply-To: dwight@geohub.gcn.uoknor.edu
- References: <1992Sep9.191134.24671@usceast.cs.scarolina.edu>
- Organization: Geosciences Computing Network, Univ. of Oklahoma
- Lines: 43
-
- In article <1992Sep9.191134.24671@usceast.cs.scarolina.edu>,
- perlman@SMTC.engr.scarolina.edu writes:
- |>Newsgroups: comp.unix.aix
- |>Path:
- |
- constellation!convex!convex!darwin.sura.net!gatech!hubcap!opusc!usceast!SMTC.engr.sca
- arolina.edu!PERLMAN
- |>From: perlman@SMTC.engr.scarolina.edu
- |>Subject: Kornshell Arithmetic
- |>Message-ID: <1992Sep9.191134.24671@usceast.cs.scarolina.edu>
- |>Sender: usenet@usceast.cs.scarolina.edu (USENET News System)
- |>Reply-To: perlman@smtc00.engr.scarolina.edu
- |>Organization: NIST Southeast Manufacturing Technology Center
- |>Date: Wed, 9 Sep 92 19:11:34 GMT
- |>
- |>It seems that ksh supports only integer arithmetic, with values
- |>entered as real numbers truncated. EX: 9 / 4 evaluates to 2
- |>
- |>My Kornshell book by Bolsky & Korn indicates a -F attribute that
- |>might let me define a variable as Floating point, but the book isn't
- |>clear how to use it or whether its available in all ksh implementations.
- |>I assume that it would be used in a typeset command, but I can't make
- |>it work.
- |>
- |>Any help? Thanks in advance!
- |>
- |>Rich.
- |>
- |>
- The AIX ksh is a POSIX 1003.2 draft compliant (which draft?) shell. My
- documentation
- doesn't show the "-F" parameter for typeset and no indication for doing floating or
- fixed point arithmetic in the shell proper. You could look into using the "bc"
- utility
- for what you need to do.
- ----------------------------------------------------------------------------
- Dwight D. Moore
- Geosciences Computing Network
- University of Oklahoma
-
- dwight@geohub.gcn.uoknor.edu (129.15.40.10)
- These opinions do not necessarily represent the opinions of OU or the GCN.
- ----------------------------------------------------------------------------
-