-
Notifications
You must be signed in to change notification settings - Fork 0
/
myuint32.m
32 lines (26 loc) · 880 Bytes
/
myuint32.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
classdef myuint32 < uint32
%MYUNIT32 Summary of this class goes here
% Detailed explanation goes here
methods(Static)
function obj = myuint32( val )
obj = obj@uint32( val );
end
function res = minus(obj,valToSubtract)
res = double( obj ) - double( valToSubtract );
res = myuint32(mod(res,2^32));
end
function res = plus(obj,valToAdd)
res = double( obj ) + double( valToAdd );
res = myuint32(mod(res,2^32));
end
function z = zeros(varargin)
if (nargin == 0)
z = myuint32(0);
elseif any([varargin{:}] <= 0)
z = myuint32.empty(varargin{:});
else
z = repmat(myuint32(0),varargin{:});
end
end
end
end