1function bits = GB_spec_nbits (type) 2%GB_SPEC_NBITS number of bits in an integer type 3% 4% bits = GB_spec_nbits ('int16') returns 16. 5 6% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. 7% SPDX-License-Identifier: Apache-2.0 8 9switch (type) 10 11 case { 'int8', 'uint8' } 12 bits = 8 ; 13 14 case { 'int16', 'uint16' } 15 bits = 16 ; 16 17 case { 'int32', 'uint32' } 18 bits = 32 ; 19 20 case { 'int64', 'uint64' } 21 bits = 64 ; 22 23 otherwise 24 error ('invalid type') ; 25end 26 27