Community
cancel
Showing results for 
Search instead for 
Did you mean: 
stanshenbin
Beginner
40 Views

atomic<float> only support fetch_and_store but not support fetch_and_add?

0 Kudos
1 Reply
RafSchietekat
Black Belt
40 Views

That would be nice and orthogonal, but neither TBB nor C++11 provide arithmetic operations for floating-point types, so they require you to cobble those together yourself (note that with TBB you'll have to be extra careful when evaluating the result of compare_and_swap, as plus zero and minus zero are different bit patterns but compare as equal for the equality operator).
Reply