Bigarray.Array0(3) OCaml library Bigarray.Array0(3)

# [NAME](#NAME)

Bigarray.Array0 - Zero-dimensional arrays.

# [Module](#Module)

Module Bigarray.Array0

# [Documentation](#Documentation)

Module **Array0**  
: **sig end**

Zero-dimensional arrays. The **Array0** structure provides operations similar to those of **Bigarray.Genarray** , but specialized to the case of zero-dimensional arrays that only contain a single scalar value. Statically knowing the number of dimensions of the array allows faster operations, and more precise static type-checking.

**Since** 4.05.0

*type* **('a, 'b, 'c)** *t*

The type of zero-dimensional Bigarrays whose elements have OCaml type **'a** , representation kind **'b** , and memory layout **'c** .

*val create* : **('a, 'b) Bigarray.kind -&gt;** **'c Bigarray.layout -&gt; ('a, 'b, 'c) t**

**Array0.create kind layout** returns a new Bigarray of zero dimension. **kind** and **layout** determine the array element kind and the array layout as described for **Bigarray.Genarray.create** .

*val init* : **('a, 'b) Bigarray.kind -&gt;** **'c Bigarray.layout -&gt; 'a -&gt; ('a, 'b, 'c) t**

**Array0.init kind layout v** behaves like **Array0.create kind layout** except that the element is additionally initialized to the value **v** .

**Since** 4.12.0

*val kind* : **('a, 'b, 'c) t -&gt; ('a, 'b) Bigarray.kind**

Return the kind of the given Bigarray.

*val layout* : **('a, 'b, 'c) t -&gt; 'c Bigarray.layout**

Return the layout of the given Bigarray.

*val change\_layout* : **('a, 'b, 'c) t -&gt;** **'d Bigarray.layout -&gt; ('a, 'b, 'd) t**

**Array0.change\_layout a layout** returns a Bigarray with the specified **layout** , sharing the data with **a** . No copying of elements is involved: the new array and the original array share the same storage space.

**Since** 4.06.0

*val size\_in\_bytes* : **('a, 'b, 'c) t -&gt; int**

**size\_in\_bytes a** is **a** 's **Bigarray.kind\_size\_in\_bytes** .

*val get* : **('a, 'b, 'c) t -&gt; 'a**

**Array0.get a** returns the only element in **a** .

*val set* : **('a, 'b, 'c) t -&gt; 'a -&gt; unit**

**Array0.set a x v** stores the value **v** in **a** .

*val blit* : **('a, 'b, 'c) t -&gt; ('a, 'b, 'c) t -&gt; unit**

Copy the first Bigarray to the second Bigarray. See **Bigarray.Genarray.blit** for more details.

*val fill* : **('a, 'b, 'c) t -&gt; 'a -&gt; unit**

Fill the given Bigarray with the given value. See **Bigarray.Genarray.fill** for more details.

*val of\_value* : **('a, 'b) Bigarray.kind -&gt;** **'c Bigarray.layout -&gt; 'a -&gt; ('a, 'b, 'c) t**

Build a zero-dimensional Bigarray initialized from the given value.

2026-10-27 OCamldoc

---

Document: Bigarray.Array0(3o) from ocaml-4 4.14.4-r4 (Chainguard OS)
Source: https://github.com/ocaml/ocaml
