首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

为什么在Julia中,负1 (-1)被提升到一个偶数的幂,返回的结果总是相同的?

在Julia中,负1 (-1)被提升到一个偶数的幂,返回的结果总是相同的。这是因为Julia中的幂运算符(^)对于复数的处理方式是通过使用复数的极坐标形式来计算的。

复数可以表示为r * exp(iθ),其中r是模长,θ是幅角。对于负1 (-1),它的模长r为1,幅角θ为π。

当负1被提升到一个偶数的幂时,Julia会将其转换为极坐标形式,并根据幂运算的性质进行计算。由于幂运算的性质中有一个规则是:对于任意复数z,z^a * z^b = z^(a+b),其中a和b是实数。

因此,当负1被提升到一个偶数的幂时,Julia会将其转换为极坐标形式的负1,即1 * exp(iπ)。由于指数函数exp(iπ)的周期性质,它的幂次方结果总是相同的。

总结起来,负1 (-1)被提升到一个偶数的幂,在Julia中返回的结果总是相同的,是因为Julia使用复数的极坐标形式进行计算,并利用幂运算的性质进行简化。

相关搜索:为什么RESTcontroller在JSON中多次返回相同的结果?为什么Future(1)在repl和编译过的prog之间返回不同的结果?在Windows10上的IE11中,Driver.getWindowHandles()总是返回1为什么Bootstrap中的col1在一个新的行中开始?如何创建一个在段落标签中显示的结果加1的按钮?在python中传递1 2 23 32 4返回max函数中的4,为什么?在C中,一个应该只返回文字1或0的函数返回2147483646?为什么在C#和PowerShell中使用完全相同的代码加密HMAC-SHA1会显示不同的结果?编写一个在R和C++中始终返回值"1“的函数为什么在0-1回归任务中,sigmoid层比tanh层的结果更差?在漂亮的汤中从相同的h1标记中从下一个跨度中抓取数据为什么在dynamoDB中插入项目时,使用相同的变量仅在1种情况下获得RecursionError如果一个整数数组被部分填充,为什么元素在最后一个填充的整数'1‘之后?(C++)在Visual Studio中:将一个文本框结果的值转换为另一个Textbox1中的值在HDFS中存储1000个1 1GB的文件和1个1000 1GB的文件以供Spark进一步使用的区别是什么?如果有的话,哪一个更好?为什么?SQL (snowflake) -如何从连接中返回1行,或者如何在第一个连接的结果中使用MAX在Angular 1.x中,当在指令中“监视”时;为什么监视返回变量的函数的行为与仅仅监视变量的行为不同?为什么在Vulkan中,VK_SAMPLE_COUNT_1_BIT是一个无效的多重采样选择?Excel如何:比较值、查找相同的值、比较相邻的值、查找较大的值并在另一个工作表中返回此数字+1Postgresql -2 DB服务器,在两者上都有一个视图,返回相同的列。如何合并成1个表
相关搜索:
页面内容是否对你有帮助?
有帮助
没帮助

相关·内容

  • Python数据分析(中英对照)·Introduction to Matplotlib and Pyplot-Matplotlib 和 Pyplot 介绍

    Matplotlib is a Python plotting library that produces publication-quality figures. Matplotlib是一个Python绘图库,用于生成出版物质量的图形。 It can be used both in Python scripts and when using Python’s interactive mode. 它既可以在Python脚本中使用,也可以在使用Python的交互模式时使用。 Matplotlib is a very large library, and getting to know it well takes time. Matplotlib是一个非常大的库,了解它需要时间。 But often we don’t need the full matplotlib library in our programs,and this is where Pyplot comes in handy. 但是我们的程序中通常不需要完整的matplotlib库,这就是Pyplot的用武之地。 Pyplot is a collection of functions that make matplotlib work like Matlab,which you may be familiar with. Pyplot是一组函数,使matplotlib像Matlab一样工作,您可能熟悉这些函数。 Pyplot is especially useful for interactive work,for example, when you’d like to explore a dataset or visually examine your simulation results. Pyplot对于交互式工作尤其有用,例如,当您希望浏览数据集或直观地检查模拟结果时。 We’ll be using Pyplot in all our data visualizations. 我们将在所有数据可视化中使用Pyplot。 Pyplot provides what is sometimes called a state machine interface to matplotlib library. Pyplot为matplotlib库提供了有时称为状态机的接口。 You can loosely think of it as a process where you create figures one at a time,and all commands affect the current figure and the current plot. 您可以粗略地将其视为一个一次创建一个地物的过程,所有命令都会影响当前地物和当前绘图。 We will mostly use NumPy arrays for storing the data that we’d like to plot, but we’ll occasionally use other types of data objects such as built-in lists. 我们将主要使用NumPy数组来存储要绘制的数据,但偶尔也会使用其他类型的数据对象,如内置列表。 As you may have realized, saying matplotlib.pyplot is kind of a mouthful, and it’s a lot to type too. 正如您可能已经意识到的那样,说matplotlib.pyplot有点口齿不清,而且打字也很费劲。 That’s why virtually everyone who uses the library imports it as plt, which is a lot shorter. 这就是为什么几乎所有使用该库的人都将其作为plt导入,而plt要短得多。 So to import the library, we will type the following– import matplotlib.pyplot as plt. 因此,要导入库,我们将键入以下内容–import matplotlib.pyplot as plt。 Now we are ready to start our plotting. 现在我们准备开始我们的阴谋。 A basis but very useful command is the plt plot function, which can be used to plot lines and markers. plt plot函数是一个基本

    03
    领券