XOR swap algorithm
id:
xor-swap-algorithm-243-7313786
title:
XOR swap algorithm
text:
In computer programming, the exclusive or swap is an algorithm that uses the exclusive or bitwise operation to swap the values of two variables without using the temporary variable which is normally required. The algorithm is primarily a novelty and a way of demonstrating properties of the exclusive or operation. It is sometimes discussed as a program optimization, but there are almost no cases where swapping via exclusive or provides benefit over the standard, obvious technique.
brand slug:
wiki
category slug:
encyclopedia
description:
Binary arithmetic algorithm
original url:
https://en.wikipedia.org/wiki/XOR_swap_algorithm
date created:
date modified:
2024-03-22T14:04:35Z
main entity:
{"identifier":"Q5318442","url":"https://www.wikidata.org/entity/Q5318442"}
image:
{"content_url":"https://upload.wikimedia.org/wikipedia/commons/8/8f/XOR_Swap.svg","width":640,"height":320}
fields total:
13
integrity:
15