16th Jul, 2020

King Fahd University of Petroleum and Minerals

顺心彩票【KOK795.COM】是亚洲地区最有影响力之一的游戏平台，顺心彩票官网涵盖各种真人客户端，体育，足球，NBA直播，电子棋牌，电子捕鱼APP！顺心彩票致力于打造亚洲最全的棋牌游戏平台。

Discussion

Started 19th Jun, 2020

I understand that we can produce that number in MATLAB by evaluating exp(1), or possibly using exp(sym(1)) for the exact representation. But e is a very common constant in mathematics and it is as important as pi to some scholars, so after all these many versions of MATLAB, why haven't they recognize this valuable constant yet and show some appreciation by defining it as an individual constant rather than having to use the exp function for that?

Dear brother and one of my best friends Mahmoud,

"you are really great researcher" This is how I see you.

Warmest regards,

Kareem

This is a coding language, not an award ceremony.

you can get euler's number with exp(1);

on the other hand, the number 'pi' can not be calculated directly from an operator like pi(1).

the imaginary number (i) can be written as sqrt(-1); but establishing distinction in the programming language between real and imaginary numbers requires declaring (i).

there are other important numbers which aren't represented at all. i.e. Fibonacci's number. what could be more important than the divine constant?

anyway, create the following matlab scrcipt:

function out=e

out = exp(1);

end

and name the file e.m, and place it in your MATLAB path.

i hope this solves your problem.

Thanks Baraa. There are a few points that I would like to comment on your answer though:

1. If speed is of concern, then the sample code you gave is slower than executing exp(1) because it involves two calls. One for e and one for exp(1).

2. Calling the file you suggested after placing it in the MATLAB path is even slower, because MATLAB searches for built-in functions first. In this case calling exp is faster indeed.

3. e in MATLAB stands for 10, so using the code you gave will conflict with the scientific notation e.

4. exp(1) will evaluate the exponential function at x = 1. Why should we evaluate a function at a number x = 1 when we already know its value (Euler's number)? Can't MATLAB just define this constant as a built-in constant and use it without having to calculate exp at x=1?

5. There are other important constants like the golden ratio that is used in various applications. In MATLAB to use this constant one way is to calculate (1+sqrt(5))/2. Why should we calculate this expression when its value is known 1.618033988749895? Can't MATLAB just define the golden ratio by this number?

6. I understand that calculating exp(1) and (1+sqrt(5))/2 are important if more than 16 significant digits are needed, but most numerical calculations are performed on double-precision floating-point systems, so their values up to this range of digits is often practical.

I started this discussion a couple of days ago on a different server, but I wanted to hear from a wider audience about this subject. If interested, you may read an extension to this topic in https://www.mathworks.com/matlabcentral/answers/549723-why-euler-s-number-e-2-71828-is-not-a-built-in-constant-in-matlab#answer_454609?s_tid=prof_contriblnk .

Best wishes,

Dr. Kareem

Maybe the reason is one that we are able to **round any number to specified number of decimal digits. **For example, if we want to round **pi** to the nearest 3 decimal digits, we will use this command: Y = round(pi, 3),

and it will result with: Y = 3.1420

Eulero number or other mathematical number are infinite. You should decide how many decimals you need. If you wait that MATLAB decide the precision of infinite long number you could wait for ages. Human life is limited.

@Anton: Thanks for sharing your comment with me. To round e using exp to say 3 digits we would type round(exp(1),3). Instead if e is defined in MATLAB by en, say, then we would type round(en,3). The former requires two function calls while the latter would require only one call. In terms of speed, the latter is reasonably faster.

@Colin: Good point. That’s why I suggest to define e as a constant instead. In most common floating-point systems, one typically use double-precision floating point representations; thus working with about 16 significant digits—with the last digit being a random junk digit in certain computations. So, defining e by this finite range of digits is very practical.

@Emad: Salam Alaikom my deer friend, colleague, and one of my favorite teachers who ever taught me. I feel so delighted that you shared your comment here in this forum. You have a point indeed that this would be a kind of redundancy. But it remains important to ask: why should we evaluate exp at x=1 when e is a very known value? In almost all algorithms I developed in my career so far, I frequently use constant parameter inputs defined as double-precision numbers, i.e. are represented by 16 significant digits. In double-precision floating-point systems, this is typically the case. So why should we ask MATLAB to compute exp at x=1 when we can use its 16 significant digits representation instead. This would be faster and computationally more efficient. How about other important constants like the golden ratio which does not occur redundant with other functions? Why should we calculate them when their values are very known values? One of the reasons MATLAB Developers are proud of is that they have a huge library of functions that can help programmers and users to do certain tasks with minimal programming efforts, but they fail to have even a decent library for important mathematical constants. If they define these constants, we could use them directly in our works without having to calculate them using other functions or formulas. To calculate an expression like sin(exp(1)*x)+3*exp(1), why should we ask MATLAB to calculate the exponential function twice at x=1, when we could easily define exp(1) as a constant, say en, and type sin(en*x)+3*en; this would be faster and computationally cost effective indeed. Of course, if one needs more accuracy than 15 or 16 significant digits, we can then ask MATLAB to evaluate the exp function at x=1. But I, as a computational mathematician, never used more than 16 significant digits in all my previous works except when I wanted to compare my approximations with the exact values of the solution—I typically prefer to use MATHEMATICA in this case. Once again I thank you for sharing your smart comment with us. Stay safe my dear teacher.

My dear Dr. Kareem

you are really great researcher

I don't realize that your point is worthy until i read your complete argument.

Great job, and I hope that they add it.

Article

Thesis (M.A.)--Wake Forest College, Department of Mathematics, 1963. Bibliography: p. 18.

Article

Full-text available

- Apr 2020

One of the most important constants of mathematics is the Euler's number. Many world mathematicians have studied the properties of number and this number has an irreplaceable place not only in mathematics but also in other scientific disciplines. In the first part of the article we will focus on the introduction of the number from a historical view...

Article

- Jul 2010

Based on the Lobatto quadrature, we develop several new closed form approximations to the mathematical constant e. For validating effectiveness of our approximations, a comparison of our results to the existing approximations is also presented. Another objective of our work is to inspire students to formulate other better approximations by using th...

Get high-quality answers from experts.

小泽玛利亚 樱井步 苍井空 石黑京香 桃谷绘里香 白咲舞 川岛和津实 黑泽爱 樱井步 小泽爱丽丝 七濑茱莉亚 樱朱音 原千寻 若菜奈央 稻森丽奈 尾野真知子 友田真希 花野真衣 雪本芽衣 雨宫真贵 冲田杏梨 高阪保奈美 霞理沙 泽井芽衣 北野望 桃谷绘理香 橋本凉 波多野结衣 仁科百华 柚木提娜 长泽梓 大沢佑香 天海翼 前田香织 前田香织 二宫沙树 铃木里美 希崎杰西卡 麻仓优 麻美由真 原更沙 葵实野理 上原瑞穂 福山沙也加 铃木麻奈美 西野翔 神谷姬 希志爱野 琴乃 希崎杰西卡 秋元里奈 原干惠 杏树纱奈 佐藤遥希 Sato Haruki 前田香织 二宫沙树 仁科百华 樱木凛 秋元里奈 小泽爱丽丝 原纱央莉 浅井舞香 音羽雷恩 天海丽 大泽佑香 百合野もも 里美尤里娅 铃原爱蜜莉 美竹铃 吉沢明步 吉泽明步 早川濑里奈 美竹凉子 松岛枫 佐佐木希 樱井梨花 立花美凉 小泉彩 里美尤里娅 铃原爱蜜莉 美竹铃 松岛枫 佐佐木希 朝美穗香 上原结衣 纹舞兰