=> 是什么意思?(等于大于)Fortran 中的平均值? [英] What does => (equals greater than) mean in Fortran?

查看:19
本文介绍了=> 是什么意思?(等于大于)Fortran 中的平均值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在查看一些旧的 Fortran 90 代码,发现了 => 符号:

I'm looking through some old Fortran 90 code and have come across the => symbol:

var => item

它似乎被用于某种任务.

It looks like it's being used for some sort of assignment.

在 Google 中搜索 箭头符号 Fortran"等于大于符号 Fortran" 没有找到相关材料.

Searching Google for "arrow symbol Fortran" or "equals greater than symbol Fortran" gives me no related material.

推荐答案

令人惊讶的是,搜索 "equals arrow symbol Fortran" 会产生一些结果.

Surprisingly, searching "equals arrow symbol Fortran" yields some results.

"=>" 通常被称为 指针赋值运算符.
(虽然它不是真正的运算符,因为它不返回任何值.)

"=>" is commonly referred to as the pointer assignment operator.
(Though it is not truly an operator as it returns no value.)

它用于将选定的参考名称与目标相关联:

reference => target

以上可以理解为引用目标"

The above can be read as "reference refers to target"

此引用通常以指针的形式出现.在这种情况下,您可以说引用指向目标".这是一种帮助记住此运算符的作用的方法,因为它的字面外观是一个从引用指向目标的箭头.

Most often this reference occurs in the form of a pointer. In this case you could say "reference points to target". This is a helpful way to remember what this operator does as its literal appearance is of an arrow pointing from reference to target.

更多用途
其他用途包括为各种项目(如模块组件、过程甚至任意表达式)制作本地别名.有关所有这些用途的完整说明,请参阅此答案.

指针赋值与传统赋值 (=)
这是来自上述链接的一个简单示例,说明了指针赋值与经典赋值 ("=") 的不同之处.基本上,这表明一旦建立了目标,指针就会被视为作为基本语句的目标.

Pointer assignment vs. Traditional Assignment (=)
Here's a quick example from the above link that illustrates how pointer assignment differs from classic assignment ("="). Basically this shows that once a target has been established, the pointer is treated as that target for basic statements.

pt => x ! pt points to x

y = pt ! y equals x

pt => y ! pt points to y

pt = 17 ! y equals 17

其他资源:
Fortran 指针的一般文档

这篇关于=> 是什么意思?(等于大于)Fortran 中的平均值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆