public static float CompareExchange(ref float location1,float value,float comparand)
https://msdn.microsoft.com/en-us/library/k9hz8w9t(v=vs.110).aspx
Compares two single-precision floating point numbers for equality and, if they are equal, replaces the first value.
/// <summary>
/// 比较location1和comparand的值,如果它们的值相等,就用value的值替换location1的值
/// </summary>
/// <param name="location1">The destination, whose value is compared with comparand and possibly replaced.</param>
/// <param name="value">The value that replaces the destination value if the comparison results in equality.</param>
/// <param name="comparand">The value that is compared to the value at location1.</param>
/// <returns>The original value in location1.</returns>
public static float CompareExchange(ref float location1, float value, float comparand)
Remarks
If comparand and the value in location1 are equal, then value is stored in location1.
Otherwise, no operation is performed.
The compare and exchange operations are performed as an atomic operation.
The return value of CompareExchange is the original value in location1, whether or not the exchange takes place.//不管exchange是否发生,返回值,都是location1原有的值
public static float CompareExchange(ref float location1,float value,float comparand)的更多相关文章
- 【java】java.lang.Math:public static long round(double a)和public static int round(float a)
package math; public class TestMath_round { public static void main(String[] args) { System.out.prin ...
- block中出现此种报错: Incompatible block pointer types initializing 'float (^__strong)(float, float)' with an expression of type 'int (^)(float, float)'
当block(代码块)的返回值是float时,应注意的地方:定义的返回值类型一定要与return的返回值类型一样 我们以两个数的四则运算来举例 在main.m文件中的四则运算中,我采用两种返回值类型( ...
- 大话java基础知识一之为什么java的主函数入口必须是public static void
为什么java的主函数入口必须是public static void main (String[] args); 很多写javaEE好几年的程序员经常会记得java的主函数就是这么写的,但实际上为什么 ...
- public static void Invoke (Action action)
using System; using System.Security.Principal; using System.Security.Permissions; namespace Demo { c ...
- Spring MVC exception - Invoking request method resulted in exception : public static native long java.lang.System.currentTimeMillis()
最近在线上系统发现下面的异常信息: 2014-10-11 11:14:09 ERROR [org.springframework.web.servlet.mvc.annotation.Annotati ...
- public static void main(String[] args){}函数理解
主函数的一般写法如下: public static void main(String[] args){…} 下面分别解释这些关键字的作用: (1)public关键字,这个好理解,声明主函数为publi ...
- 为什么接口要规定成员变量必须是public static final的呢?(转)
在interface里面的变量默认都是public static final 的.所以可以直接省略修饰符: String param="ssm"://变量需要初始化 为什么接口要规 ...
- public static void main(String[] args){}函数诠释
public static void main(String[] args){}函数诠释 主函数的一般写法如下: public static void main(String[] args){-} 下 ...
- static public和 public static 区别
static:加static 的是静态成员,不能实例化在你运行的时候他自己在内存中开辟了块空间,不用在new, 有点像全局变量,如果不用你必须去 实例化(new)才能用 static是静态的意思,pu ...
随机推荐
- jQuery实现页面锚点滚动效果
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- C#——枚举格式转换与比较
定义一个枚举类型: public enum City { 北京, 上海, 广州 } 控制台判断: static void Main(string[] args) { Console.WriteLine ...
- 【YOLO】只检测人
一.修改源代码 cfg/coco.data classes= #修改成1 train = /home/pjreddie/data/coco/trainvalno5k.txt valid = coco_ ...
- Linux常用命令(简单的常用)
1. 文件和目录 cd /home 进入 '/ home' 目录' cd .. 返回上一级目录 cd ../.. 返回上两级目录 cd 进入个人的主目录 cd ~user1 进入个人的主目录 cd ...
- webstorm_completion
js 使用yarn 安装声明定义文件 @types/xxx koa ==> @types/koa koa-router ==> @types/koa-router 安装webstorm中的 ...
- mysql在windows上安装
一.在window上安装mysql MySQL是一个小巧玲珑但功能强大的数据库,目前十分流行.但是官网给出的安装包有两种格式,一个是msi格式,一个是zip格式的.很多人下了zip格式的解压发现没有s ...
- C#学习笔记_11_方法的隐藏和重写
11_方法的隐藏和重写 方法的隐藏 需要使用到关键字:new 方法的重写 虚函数: 使用关键字virtual修饰的函数 虚函数可以被子类隐藏,也可以被子类重写 非虚函数只能被子类隐藏 关键字:over ...
- 6.3.4 使用marshal 模块操作二进制文件
Python 标准库 marshal 也可以进行对象的序列化和反序列化,下面的代码进行了简单演示. import marshal x1 = 30 x2 = 5.0 x3 = [1,2,3] x4 = ...
- Python 4 循环语句while
while [条件]: 条件这里满足布尔运算True则无限循环while里面代码. 固定条件的 基本的while循环, 如果if匹配那么 则执行打印登录成功,和break跳出整个循环, ...
- poj 2553强连通+缩点
/*先吐槽下,刚开始没看懂题,以为只能是一个连通图0T0 题意:给你一个有向图,求G图中从v可达的所有点w,也都可以达到v,这样的v称为sink.求这样的v. 解;求强连通+缩点.求所有出度为0的点即 ...