Searching \ for 'mixed types multiplication bug V2.3' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/method/math.htm?key=multiplication
Search entire site for: 'mixed types multiplication bug V2.3'.

Truncated match.
PICList Thread
'mixed types multiplication bug V2.3'
2007\10\01@165458 by Gordon Williams

picon face
I've run into a number of problems like this one not giving me the correct
answer.

exp_b is a sbyte
temp_b is a sbyte*3

;  322   temp_b = exp_b * 512     ;put it in sbyte*3
                              clrf     v_temp_b
                              clrf     v_temp_b+1
                              clrf     v_temp_b+2

As you can see I always will get zero!

This is one example of a few times this has caught me.

Regards,

Gordon Williams

2007\10\01@170311 by Dario Greggio

face picon face
Gordon Williams wrote:

> exp_b is a sbyte
> temp_b is a sbyte*3
>
> ;  322   temp_b = exp_b * 512     ;put it in sbyte*3
>                                clrf     v_temp_b
>                                clrf     v_temp_b+1
>                                clrf     v_temp_b+2
>
> As you can see I always will get zero!


exp_b can't hold a larger value than 255, so it will be "0" after the
multiply.

Try casting it to a long or such

2007\10\02@091734 by Gordon Williams

picon face
Sent this message through yesterday and haven't seen it yet :(

----- Original Message -----
From: "Gordon Williams" <spam_OUTg_willTakeThisOuTspamcyberus.ca>
To: "pic microcontroller discussion list" <.....piclistKILLspamspam@spam@mit.edu>
Sent: Monday, October 01, 2007 5:01 PM
Subject: mixed types multiplication bug V2.3


{Quote hidden}

2007\10\02@092231 by Dario Greggio

face picon face
Gordon Williams wrote:

> Sent this message through yesterday and haven't seen it yet :(

you not, but I did see & replied :-)))


--
Ciao, Dario il Grande (522-485 a.C.)
--
ADPM Synthesis sas - Torino
--
http://www.adpm.tk

More... (looser matching)
- Last day of these posts
- In 2007 , 2008 only
- Today
- New search...