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)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 先序,中序,后序线索二叉树
- 下一篇: ubuntu安装 zookeeper3.