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.

  1. /// <summary>
  2. /// 比较location1和comparand的值,如果它们的值相等,就用value的值替换location1的值
  3. /// </summary>
  4. /// <param name="location1">The destination, whose value is compared with comparand and possibly replaced.</param>
  5. /// <param name="value">The value that replaces the destination value if the comparison results in equality.</param>
  6. /// <param name="comparand">The value that is compared to the value at location1.</param>
  7. /// <returns>The original value in location1.</returns>
  8. 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)的更多相关文章

  1. 【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 ...

  2. block中出现此种报错: Incompatible block pointer types initializing 'float (^__strong)(float, float)' with an expression of type 'int (^)(float, float)'

    当block(代码块)的返回值是float时,应注意的地方:定义的返回值类型一定要与return的返回值类型一样 我们以两个数的四则运算来举例 在main.m文件中的四则运算中,我采用两种返回值类型( ...

  3. 大话java基础知识一之为什么java的主函数入口必须是public static void

    为什么java的主函数入口必须是public static void main (String[] args); 很多写javaEE好几年的程序员经常会记得java的主函数就是这么写的,但实际上为什么 ...

  4. public static void Invoke (Action action)

    using System; using System.Security.Principal; using System.Security.Permissions; namespace Demo { c ...

  5. 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 ...

  6. public static void main(String[] args){}函数理解

    主函数的一般写法如下: public static void main(String[] args){…} 下面分别解释这些关键字的作用: (1)public关键字,这个好理解,声明主函数为publi ...

  7. 为什么接口要规定成员变量必须是public static final的呢?(转)

    在interface里面的变量默认都是public static final 的.所以可以直接省略修饰符: String param="ssm"://变量需要初始化 为什么接口要规 ...

  8. public static void main(String[] args){}函数诠释

    public static void main(String[] args){}函数诠释 主函数的一般写法如下: public static void main(String[] args){-} 下 ...

  9. static public和 public static 区别

    static:加static 的是静态成员,不能实例化在你运行的时候他自己在内存中开辟了块空间,不用在new, 有点像全局变量,如果不用你必须去 实例化(new)才能用 static是静态的意思,pu ...

随机推荐

  1. 《Java编程的逻辑》第一部分 编程基础与二进制

  2. 03-Servlet 体系结构知识梳理

    一.Servlet体系结构 Java Web应用是基于Servlet规范运行,Servlet顶层类的关联如下图: 从图可看出,Servlet规范基本围绕这几个类运行,其中,与Servlet主动关联的有 ...

  3. RTL Compiler之Example

    Synthesis = Translation +  Logic Optimization + Mapping Step 1 Source files 1) make directory mkdir ...

  4. 【sqli-labs】 less46 GET -Error based -Numeric -Order By Clause(GET型基于错误的数字型Order By从句注入)

    http://192.168.136.128/sqli-labs-master/Less-46/?sort=1 sort=4时出现报错 说明参数是添加在order by 之后 错误信息没有屏蔽,直接使 ...

  5. (转) 分布式文件存储FastDFS(一)初识FastDFS

    http://blog.csdn.net/xingjiarong/article/details/50559849 一.FastDFS简介 FastDFS是一款开源的.分布式文件系统(Distribu ...

  6. @RequestMapping与controller方法返回值介绍

    @RequestMapping url映射:定义controller方法对应的url,进行处理器映射使用.@RequestMapping(value="/item")或@Reque ...

  7. JTable设置表格背景颜色——隔行不同

    package view; import java.awt.Color; import java.awt.Component; import javax.swing.JLabel; import ja ...

  8. ModelBinder 请求容错性

    代码 //using System.Web.Mvc; public class TrimToDBCModelBinder : DefaultModelBinder { public override ...

  9. json 添加 和删除两种方法

    <script> var test = { name: "name", age: "12" }; var countrys = { "ne ...

  10. Gym - 101611D Decoding of Varints(阅读理解题 )

    Decoding of Varints ​ 题意&思路: 首先根据红色边框部分的公式算出x,再有绿色部分得知,如果x是偶数则直接除以2,x是奇数则(x+1)/-2. PS:这题有数据会爆掉un ...