arithmetic和algorithm之间的区别?

阅读胡伟武老师的高性能计算机中有一句:50-60年代 Computer Architecture=Computer Arithmetic.查了下有道字典,Arithmetic的中文翻译是算术,算法的意思。那为什么不适用Algorithm呢?它们之间有什么区别呢?查了一下午终于搞明白了。
Algorithm的英文定义是:
An algorithm is a set of rules for solving a math problem which, if done properly, will give a correct answer each time.
翻译成中文:算法是指解决数学问题的一组规则,如果操作适当,每一次都可以得到正确的结果。
更加通俗的解释是:
it is a step-by-step procedure for calculations. Algorithms are used for calculation, data processing, and automated reasoning.and arithmetic. <1>

算法是一步一步的计算过程,可以用作计算,数据处理,自动推理和算术。

而Arithmetic在Wikipedia中解释是:

Arithmetic or arithmetics (from the Greek word ἀριθμόςarithmos "number") is the oldest[1] and most elementary branch of mathematics, used very popularly, for tasks ranging from simple day-to-day counting to advanced science and business calculations. It involves the study of quantity, especially as the result of operations that combine numbers.<2>

翻译成中文:Arithmetic是数学中最古老和最原始的应用非常广泛的一个分支。它可以用来解决从简单的日常计数到先进的科学和商业计算各种任务。它涉及到数量的研究,特别是结合数字的操作的结果。

从上面的分析可以基本上厘清他们之间的关系。

Algorithm研究解决难题思路和方法的科学,他属于计算机科学领域。而Arithmetic解决如何更快更精确计算的科学,属于数学领域。涉及到常用的运算:+—x÷。

更为详细的区别可以参考:文章Algorithms and Arithmetic inEveryday Mathematics

 

参考文献:

<1>yahoo:Is there a difference between algorithm and arithmetic?:http://answers.yahoo.com/question/index?qid=20120509221101AADCFk7:

<2>wikipedia:Arithmetic:http://en.wikipedia.org/wiki/Arithmetic

<3>补充阅读:Algorithms and Arithmetic in Everyday Mathematicshttp://instruction.aaps.k12.mi.us/EM_parent_hdbk/algorithms.html

什么是架构设计?架构设计看这篇文章就够了

Redis为什么这么快?

重磅:解读2020年最新JVM生态报告

BIO,NIO,AIO 总结

JDK8的新特性,你知道多少?

回复“资料”,免费获取 一份独家呕心整理的技术资料!image

 

  • 4
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
Create a class called Rational for performing arithmetic with fractions. Use integer variables to represent the private data of the class – the numerator and the denominator. Provide a constructor that enables an object of this class to be initialized when it’s declared. The constructor should store the fraction in reduced form. For example, the fraction would be stored in the object as 1 in the numerator and 2 in the denominator. In order to compute the reduced form, you need to write a reduction function which uses the Euclidean algorithm to get the greatest common divisor (GCD) of the numerator and denominator first and then divides GCD to get the reduced numerator and denominator. Provide public member functions that perform each of the following tasks:(a) Subtract a Rational number from the other Rational number. The result should be stored in reduced form. (b) Divide a Rational number by the other Rational number. The result should be stored in reduced form. (c) Print Rational numbers in the form a/b, where a is the numerator and b is the denominator. (d) Compare two Rational numbers to make sure which one is smaller or they are equal. (1 for the first number, 2 for the second number and 0 if they are equal) Please also write a main function to prompt the user to input two Rational numbers . Subtract one number from the other from these two numbers using (a) and then print the result using (c). Divide one number from the other from these two numbers using (b) and then print the result using (c). Compare these two Rational numbers using (d) and indicate which one is smaller or they are equal.用c++ 寫出和上面不一樣的版本,要用using namespace std; 的版本,並且要有註解
05-30

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

非典型理科男

1毛钱打赏,让作者更有动力噢

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值