1function C = fix (G)
2%FIX Round towards zero.
3% C = fix (G) rounds the entries in the matrix G to the nearest integers
4% towards zero.
5%
6% See also GrB/ceil, GrB/floor, GrB/round.
7
8% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
9% SPDX-License-Identifier: GPL-3.0-or-later
10
11Q = G.opaque ;
12
13if (gb_isfloat (gbtype (Q)) && gbnvals (Q) > 0)
14    C = GrB (gbapply ('trunc', Q)) ;
15else
16    C = G ;
17end
18
19