From: Avengeline on
dpb <none(a)non.net> wrote in message <hkftqn$hlk$1(a)news.eternal-september.org>...
> Avengeline wrote:
> > I have 2 values of:
> >
> > e = 98;
> > f = 77;
> >
> > f - e should be equals to -21, but MATLAB says its 0. Can anyone help?
> >
> > A photo of the problem is attached here:
> >
> > http://farm5.static.flickr.com/4031/4331616010_c941b62a0f_b.jpg
>
> Well, the variable editor indicates e is an uint8 which means if f is
> also the result would also be unsigned which would underflow.
>
> What does
>
> double(f)-double(e)
>

Thanks. I have changed to a = f - e; a = int8(a);
> return?
>
> --
First  |  Prev  | 
Pages: 1 2
Prev: Binary integer programming
Next: read struct