home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / aix / 9531 < prev    next >
Encoding:
Text File  |  1992-09-10  |  2.3 KB  |  57 lines

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