RunMat
  • Pricing
RunMat
GitHub
GitHub
DownloadSign InTry in Browser
DesktopRuntimeServer
RunMat

Run math blazing fast

GitHubX (Twitter)LinkedIn

Company

  • About
  • Pricing
  • Contact
  • License
  • Privacy

Learn

  • Docs
  • Blog
  • Benchmarks
  • RunMat vs MATLAB Online

Get product updates and release notes from the RunMat team.

© 2026 Dystr · Made withfor the scientific community.

RunMat™ is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

/
See all docs
Builtin Reference
    • and
    • bitand
    • bitcmp
    • bitget
    • bitor
    • bitset
    • bitshift
    • bitxor
    • not
    • or
    • xor

bitxor — Compute the bitwise exclusive OR of integer-valued arrays.

C = bitxor(A,B) computes a bitwise exclusive OR. Compatible array sizes use implicit expansion, while the optional assumedtype interprets integer-valued double input using a named integer class.

Syntax

C = bitxor(A, B)
C = bitxor(A, B, assumedtype)

Inputs

NameTypeRequiredDefaultDescription
ANumericArrayYes—Left integer-valued input.
BNumericArrayYes—Right integer-valued input.
assumedtypeStringScalarNo—Integer class used to interpret double inputs.

Returns

NameTypeDescription
CNumericArrayBitwise numeric result.

Errors

IdentifierWhenMessage
RunMat:bitwise:InvalidInputInputs are not finite integer-valued numeric, logical, or gatherable gpuArray values.bitwise operation: invalid input
RunMat:bitwise:SizeMismatchInput shapes violate the operation's expansion rule: binary bitwise functions use compatible-size expansion, while bit positions/counts require scalar expansion or exactly matching nonscalar sizes.bitwise operation: array sizes are not compatible

How bitxor works

  • All eight integer classes are supported on the host and preserve their class.
  • Inputs must share an integer class unless the companion is an allowed scalar double.
  • Logical inputs produce logical output and compatible nonscalar sizes use MATLAB implicit expansion.
  • Supported gpuArray forms return resident output; signed, 64-bit, and assumedtype GPU forms are rejected in MATLAB-compatible mode.

Using bitxor with coding agents

Open a RunMat example with live inputs, then ask the agent to explain how bitxor changes the result.

Run a small bitxor example, explain the result, then change one input and compare the output.

Related Logical functions

Bit

and · bitand · bitcmp · bitget · bitor · bitset · bitshift · not · or · xor

Tests

allfinite · isfinite · isgpuarray · isinf · islogical · isnan · isnumeric · isreal · issparse

Rel

eq · ge · gt · isequal · isequaln · le · lt · ne

Logical

logical

Open-source implementation

Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how bitxor is executed, line by line, in Rust.

  • View the source for bitxor in Rust on GitHub
  • Learn how the RunMat runtime works
  • Found a bug? Open an issue with a minimal reproduction.

About RunMat

RunMat is an open-source runtime that executes MATLAB-syntax code blazing on any GPU. It is licensed under the Apache 2.0 license.

  • RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
  • Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.

Getting started · Benchmarks · Pricing

Download RunMat

Download RunMat for full performance, or use RunMat in your browser for zero setup.

Download RunMatOpen Sandbox
On this page
  • Syntax
  • Inputs
  • Returns
  • Errors
  • How bitxor works
  • Using bitxor with coding agents
  • Related Logical functions
  • Bit
  • Tests
  • Rel
  • Logical
  • Open-source implementation
  • About RunMat