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

Source: Internet
Author: User

https://msdn.microsoft.com/en-us/library/k9hz8w9t (v=vs.110). aspx

Compares-single-precision floating point numbers for equality and, if they is equal, replaces the first value.

        /// <summary>        ///Compare the values of Location1 and Comparand, and if their values are equal, replace the value of Location1 with value/// </summary>        /// <param name= "Location1" >the destination, whose value is compared with comparand and possibly replaced.</param>        /// <param name= "value" >The value is replaces the destination value if the comparison results in equality.</param>        /// <param name= "Comparand" >The value is compared to the value at Location1.</param>        /// <returns>The original value in Location1.</returns>         Public Static floatCompareExchange (ref floatLocation1,floatValuefloatComparand)

Remarks

If comparand and the value in location1 was equal, then value was stored in location1 .

Otherwise, no operation is performed.

The Compare and exchange operations is performed as an atomic operation.

The return value of CompareExchange is the original value in location1, whether or not the exchange takes place .//Regardless of whether exchange occurs, the return value is the original value of Location1

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.