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

Run math blazing fast

GitHubX (Twitter)LinkedIn

Company

  • About
  • Pricing
  • Contact

Explore

  • RunMat for academia
  • RunMat vs MATLAB Online
  • Benchmarks

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.

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

bitor — Compute bitwise OR for integer-valued scalars and arrays.

bitor(A, B) applies bitwise OR to same-class logical, integer, or finite nonnegative integer-valued double inputs using MATLAB-style implicit expansion. bitor(A, B, assumedtype) selects the signed or unsigned interpretation width for double inputs.

Syntax

C = bitor(A, B)
C = bitor(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 bitor works

  • Accepts double integer-valued inputs, logical inputs, and all eight built-in integer classes.
  • Supports implicit expansion across compatible shapes.
  • Inputs must have the same data type unless one is a scalar double; the result has that shared type or the nondouble integer type.
  • Logical inputs return logical output, integer inputs preserve their exact native class, and double inputs return double.
  • Signed integer inputs and signed assumed types use two's-complement bit patterns.
  • Rejects fractional, out-of-range, infinite, NaN, complex, mixed integer-class, string, cell, and struct inputs.

Does RunMat run bitor on the GPU?

The documented GPU domain accepts two unsigned integer arrays, or one unsigned integer array and one scalar double; 64-bit integers and assumedtype are unsupported.

RunMat mode separately gates single input, broader resident dtypes, and resident assumedtype calls as extensions.

GPU memory and residency

Documented uint8, uint16, and uint32 GPU inputs gather exactly for host execution and the result is restored to the owning provider.

Example

Scalar bitwise OR

bitor(5, 3)

Expected output:

ans = 7

Using bitor with coding agents

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

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

FAQ

Can bitor broadcast scalar masks?⌄

Yes. Scalar masks expand across array inputs using MATLAB-compatible implicit expansion.

Related Logical functions

Bit

and · bitand · bitcmp · bitget · bitset · bitshift · bitxor · 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 bitor is executed, line by line, in Rust.

  • View the source for bitor 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 bitor works
  • Does RunMat run bitor on the GPU?
  • GPU memory and residency
  • Example
  • Scalar bitwise OR
  • Using bitor with coding agents
  • FAQ
  • Related Logical functions
  • Bit
  • Tests
  • Rel
  • Logical
  • Open-source implementation
  • About RunMat