# Modulo

A modulo designates the number of groups (measured in frames)
in the primary file space, as indicated during the creation or reallocation
of the file.

The modulo is always an integer remainder in the range
0 to modulo-1. The formula to determine the frame number of the initial
frame of the group where the item is located is:

FID=base+(item-ID/modulo)

This initial frame number is commonly called the base FID.

The modulo of a file is a critical component of the hashing algorithm
access method. It should never be altered in any file-defining item,
as this can cause problems such as file inconsistencies.

During
the full or account-restore processes, files are
resized according to the optional modulo found in the reallocation
attribute (attribute 13) of the file-defining item. After changing
to the new modulo, all items must be rehashed before they are replaced.
This can cause restore processes (also t-load and copy) to run considerably slower.

Note: The maximum
allowed modulo for a file in the VME is 16777213.

## See also

- [create-file command](https://d3codex.com/tcl/create-file-command/)
- [f.modulo command](https://d3codex.com/tcl/f-modulo-command/)
- [File inconsistency handler](https://d3codex.com/definitions/file-inconsistency-handler/)
- [Frame](https://d3codex.com/definitions/frame/)
- [Full restore](https://d3codex.com/definitions/full-restore/)
- [Group](https://d3codex.com/definitions/group/)
- [Hashing](https://d3codex.com/definitions/hashing/)
- [item command](https://d3codex.com/tcl/item-command/)
- [Item-ID](https://d3codex.com/definitions/item-id-glossary/)
- [Linked overflow](https://d3codex.com/definitions/linked-overflow/)
- [modulo](https://d3codex.com/attributedefiningitem/modulo-attribute-defining-items/)
- [Primary file space](https://d3codex.com/definitions/primary-file-space/)
- [resize command](https://d3codex.com/tcl/resize-command/)
- [t-load command](https://d3codex.com/tcl/t-load-command/)

---
Source: https://d3codex.com/definitions/modulo-glossary/ - part of the D3Codex reference.
