免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1606 | 回复: 6
打印 上一主题 下一主题

[学习分享] 请问关于bc命令的解释 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-06-07 09:42 |只看该作者 |倒序浏览
本帖最后由 yuandeshen 于 2013-06-07 15:19 编辑

scale=5000; a(1)*4 | bc -l

请问这个,怎么解释,谢谢。

论坛徽章:
16
IT运维版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每月发帖之星
日期:2015-09-11 19:30:52IT运维版块每周发帖之星
日期:2015-09-11 19:20:31IT运维版块每日发帖之星
日期:2015-08-26 06:20:00每日论坛发贴之星
日期:2015-08-20 06:20:00IT运维版块每日发帖之星
日期:2015-08-20 06:20:002015年辞旧岁徽章
日期:2015-03-03 16:54:15金牛座
日期:2014-05-04 16:58:09双子座
日期:2013-12-17 16:44:37辰龙
日期:2013-11-22 15:20:59狮子座
日期:2013-11-18 22:55:08射手座
日期:2013-11-12 10:54:26
2 [报告]
发表于 2013-06-07 10:25 |只看该作者
语法错误啊。。。。
NAME
       bc - An arbitrary precision calculator language

SYNTAX
       bc [ -hlwsqv ] [long-options] [  file ... ]

VERSION
       This man page documents GNU bc version 1.06.

DESCRIPTION
       bc is a language that supports arbitrary precision numbers with interactive execution of statements.  There are some similarities in the syntax
       to the C programming language.  A standard math library is available by command line option.  If requested, the math library is defined  before
       processing  any  files.   bc starts by processing code from all the files listed on the command line in the order listed.  After all files have
       been processed, bc reads from the standard input.  All code is executed as it is read.  (If a file contains a command to halt the processor, bc
       will never read from the standard input.)

       This  version  of  bc contains several extensions beyond traditional bc implementations and the POSIX draft standard.  Command line options can
       cause these extensions to print a warning or to be rejected.  This document describes the language accepted by this processor.  Extensions will
       be identified as such.

论坛徽章:
0
3 [报告]
发表于 2013-06-07 11:00 |只看该作者
回复 2# wenhq
不会吧,这个脚本能运行啊


    CONCURRENCY=64
TIME_START=`date`
for ((idx = 0; idx < $CONCURRENCY; idx++))
do
    time echo "scale=5000; a(1)*4" | bc -l > /dev/null &
done

echo    "$TIME_START Start"

论坛徽章:
29
技术图书徽章
日期:2013-09-02 19:59:502015元宵节徽章
日期:2015-03-06 15:51:332015小元宵徽章
日期:2015-03-06 15:57:20操作系统版块每日发帖之星
日期:2015-08-16 06:20:002015七夕节徽章
日期:2015-08-21 11:06:17操作系统版块每日发帖之星
日期:2015-09-21 06:20:002015亚冠之水原三星
日期:2015-10-30 00:06:07数据库技术版块每日发帖之星
日期:2015-12-24 06:20:0015-16赛季CBA联赛之上海
日期:2016-01-07 10:32:07操作系统版块每日发帖之星
日期:2016-01-08 06:20:00操作系统版块每日发帖之星
日期:2016-05-18 06:20:00IT运维版块每日发帖之星
日期:2016-07-23 06:20:00
4 [报告]
发表于 2013-06-07 13:59 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
5 [报告]
发表于 2013-06-07 15:23 |只看该作者
回复 4# Hongqiyaodao

不好意思,a(1)*4,反切弧,实在愚钝,不明白
   

论坛徽章:
33
ChinaUnix元老
日期:2015-02-02 08:55:39CU十四周年纪念徽章
日期:2019-08-20 08:30:3720周年集字徽章-周	
日期:2020-10-28 14:13:3020周年集字徽章-20	
日期:2020-10-28 14:04:3019周年集字徽章-CU
日期:2019-09-08 23:26:2519周年集字徽章-19
日期:2019-08-27 13:31:262016科比退役纪念章
日期:2022-04-24 14:33:24
6 [报告]
发表于 2013-06-07 16:46 |只看该作者
本帖最后由 Shell_HAT 于 2013-06-07 16:51 编辑

回复 3# yuandeshen


这里用的就是反三角函数atan(),在bc中是用a()来表示。atan(1)*4就是圆周率嘛

论坛徽章:
0
7 [报告]
发表于 2013-06-08 13:26 |只看该作者
回复 6# Shell_HAT


    谢谢,明白了,就是pi,如果scale=1024,就是super pi软件跑1M的意思对不?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP