https://yq.aliyun.com/articles/279384

expr % expr
   The  result of the expression is the "remainder" and it is com‐
   puted in the following way.  To compute a%b, first a/b is  com‐
   puted to scale digits.  That result is used to compute a-(a/b)*b
   to the scale of the maximum of scale+scale(b) and scale(a).   If
   scale  is  set  to  zero  and both expressions are integers this
   expression is the integer remainder function.

# bc -l
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
1/3
.33333333333333333333
--//可以看出使用math 库,缺省scale=20.
--//而如果不使用-l参数scale=0.

--//这样如果在scale=20的情况,取模使用是这样.

12312324/1232
9993.76948051948051948051

12312324-9993.76948051948051948051*1232
.00000000000000001168

scale=2
12312324%1232
11.68

12312324/1232
9993.76
--//bc竟然没做四舍五入.

12312324-9993.76*1232
11.68

===========================

C:\Windows\system32>bc
bc 1.05
Copyright 1991, 1992, 1993, 1994, 1997, 1998 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
1/3
0

C:\Windows\system32>bc -l
bc 1.05
Copyright 1991, 1992, 1993, 1994, 1997, 1998 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
1/3
.33333333333333333333

(interrupt) use quit to exit.

C:\Windows\system32>

vim的修改

最新文章

  1. WCF学习之旅—实现REST服务(二十二)
  2. .ashx中使用Session
  3. Canvas绘制图形
  4. MIME参考列表
  5. gcc 版本降级
  6. java中String的常用方法
  7. openstack context
  8. MON166 FAQ
  9. 09 - 删除vtkDataObject中的ShouldIReleaseData() and ReleaseDataFlag 方法 VTK 6.0 迁移
  10. C# 泛型 Func<object, string, bool> filter
  11. HttpClient 4.3连接池参数配置及源码解读
  12. 201521123029《java程序设计》第2周学习总结
  13. 团队项目第二阶段个人进展——Day4
  14. 使用autohotkey修改方向键、回车和启动程序
  15. vue组件通信那些事儿
  16. kubernetes环境搭建
  17. [动态dp]线段树维护转移矩阵
  18. SpringBoot与docker
  19. webpack 4 知识点
  20. Influxdb安装部署

热门文章

  1. 微信小程序从零开始开发步骤(七)引入外部js 文件
  2. [RxJS] Marbles Testings
  3. 6.Windows 二进制文件 (.exe)安装--终端安装
  4. ASP.NET MVC 4 (十一) Bundles和显示模式--asp.net mvc中 @Scripts.Render("~/bundles/jquery")是什么意思? 在布局文件中使用Scripts.Render()输出脚本包,Styles.Render()输出风格包:
  5. windows防火墙开放zabbix端口(批处理)
  6. Android Service com.android.exchange.ExchangeService has leaked ServiceConnection
  7. [python]bug和debug
  8. .net core 修改网站启动端口
  9. JSP学习 —— 开篇:JSP,servlet容器,Tomcat,servlet容器之间的关系
  10. 关于javascript中私有作用域的预解释