|
- Forum - iziBasic
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257
Sujet n° 1399 |
multiplying variables doesn't work? |
le 02/05/2006 @ 18:05 par bh77a
|
Hi,
When I try:
A=5 B=5 C=A*B PRINT C
The display is 2.5000000e01
When I try
C=5*5 PRINT C
The display is 25
Is this a problem on my behalf... as soon as I solve this ellipses will be on the way!!! It is important so that if one doesn't have access to the source code one can dictate its parameters.
Regards, bh77a |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 1 -------- le 02/05/2006 @ 19:04 par aldweb
visiteur |
Hopefully, it does work. Please don't scare people with such a title!
On my Tungsten C, I always get 2.5000000e01, in both cases you submitted.
Furthermore 2.5000000e01 and 25 are just the same value, one expressed in exponential notation, the other one in plain integer.
PRINT C should display 2.5000000e01 (default display) PRINT C USING 0 should display 25
Isn't it the case with you?
Cheers, aldweb
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 2 -------- le 02/05/2006 @ 20:02 par bh77a
visiteur |
Dear Aldweb,
I apologize for such a title... it was in frustration to several days of trying to get code to work...
In short, I have developed a simple bit of code to allow the user to draw ellipses, both hollow and filled. Here is the code...
REM location - defined by user or gathered by pen tap C=40 D=40
S=0.01 B=0 F=PI
FOR I=0.00 TO F STEP S X=COS(I) X=(X*30) Y=SIN(I) Y=(Y*10)
V=C+X:U=D+Y Z=C-X:W=D-Y
PSET V,U PSET V,W PSET Z,W PSET Z,U NEXT
This will draw a very fast hollow ellipse. The problem is that I would like to be able to set the
X=(X*30) Y=(Y*10)
lines to user defined variables such as
A=30:B=10 REM perhaps gathered by pen coordinates for drawing X=(X*A) Y+(Y*B)
The problem is that this doesn't work for me... it only produces a straight line. Any thoughts would be most appreciated.
Again, I apologize for the *scary* title. Your math works properly, my code does not...
Regards, bh77a |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 3 -------- le 02/05/2006 @ 22:07 par bh77a
visiteur |
Hi,
I have solved the problem... very, very, very, very, very stupid mistake by ME. Aldweb's program iziBasic does it's math perfectly. Please don't tell the math teacher down the hall of the troubles I have :).
Regards, bh77a |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 4 -------- le 06/05/2006 @ 14:43 par aldweb
visiteur |
Well, maybe the math teacher does not know how to program...
Cheers
@+ aldweb |
|
|
sujet actif
sujet clos
Important!
Nouveau message -
Rectifier message
Clôturer sujet
Remonter
|
|