min_int_type.m

From Spinach Documentation Wiki
Revision as of 21:49, 22 February 2026 by Kuprov (talk | contribs) (Fix lead description from MATLAB header (folding/hyphenation pass))
Jump to: navigation, search

Minimum integer data type sufficient to store the specified value. Useful in many indexing operations in the Spinach kernel where double precision would be a massive overkill.

Syntax

           type=min_int_type(max_val,issigned)

Arguments

       max_val  - maximum value that the integer
                  must cover
       issigned - whether the integer needs to
                  cover the negative values:
                  'signed' or 'unsigned'

Outputs

       type     - Matlab data type to use

Examples

See examples in the Spinach distribution relevant to this function.

Notes

This page was generated from the function header in the Spinach repository.

See also


Version 2.11, authors: Ilya Kuprov