码迷,mamicode.com
首页 > 其他好文 > 详细

public static float CompareExchange(ref float location1,float value,float comparand)

时间:2016-04-28 15:27:06      阅读:143      评论:0      收藏:0      [点我收藏+]

标签:

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)

标签:

原文地址:http://www.cnblogs.com/chucklu/p/5442774.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!