爱问知识人 爱问教育 医院库

Unix下该如何进行常用数学计算?

首页

Unix下该如何进行常用数学计算?

Linux/Unix下该如何进行常用数学计算?

提交回答

全部答案

    2017-07-27 23:48:19
  •   用shell中的万能的awk
    看一些简单的事例:  [oracle@asm tmp]$ gdb  GNU gdb Red Hat Linux (6。3。0。0-1。63rh)  Copyright 2004 Free Software Foundation, Inc。
        GDB is free software, covered by the GNU General Public License, and you are  welcome to change it and/or distribute copies of it under certain conditions。
        Type "show copying" to see the conditions。  There is absolutely no warranty for GDB。 Type "show warranty" for details。  This GDB was configured as "i386-redhat-linux-gnu"。
        (gdb) p 1。4*123。324*3  $1 = 517。96079999999995  (gdb) p /x 1。4*123。324*3  $2 = 0x205  (gdb) p /x 4*24  $3 = 0x60  (gdb)  [oracle@asm tmp]$ echo | awk '{print 1。
      1*2*23。34;}'  51。348  [oracle@asm tmp]$ awk 'BEGIN {print (1。25^10);}'  9。31323来源:www。examda。com  awk 支持不少常见的运算符, 如:  + (加),- (减), * (乘), / (除), ^ 或 **(乘方), % 取模) 等等。
        此外, awk 也提供了一些常用的数学函数, 比如 sin(x), cos(x), exp(x), log(x), sqrt(x), rand()。 使用这些运算符和函数可以直接进行一些简单的运算:  [oracle@asm tmp]$ echo | awk '{print sin(2);}'  0。
      909297 。

    你***

    2017-07-27 23:48:19

相关推荐

正在加载...
最新问答 推荐信息 热门专题 热点推荐
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200

热点检索

  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
返回
顶部
帮助 意见
反馈

确定举报此问题

举报原因(必选):