Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / another variable problem

Author
Message
glint
22
Years of Service
User Offline
Joined: 9th Feb 2004
Location: the Synth
Posted: 25th May 2004 06:20
This problem has been particularly troublesome.

Try this short program. It will not print anything when run on my computer (even if the "not" is removed). Does anyone know what is going on?

Sorry, I realize this isn't exactly 2-D material, but I don't think they would want me posting this in the Bugs forum.

Here's the code :

x=100
y=-20
if x/abs(x)=y/abs(y) then print "x"
wait key

(Is there a command that will find the sign of a variable? It would be much more streamlined than this).
M00NSHiNE
22
Years of Service
User Offline
Joined: 4th Aug 2003
Location: England, UK
Posted: 25th May 2004 16:26
try:

x=100
y=-20
xequals=x/abs(x)
yequals=y/abs(y)
if xequals=yequals then print "x"
wait key

BigDan256
22
Years of Service
User Offline
Joined: 29th Oct 2003
Location: NSW, Australia
Posted: 27th May 2004 10:46
try:

x=100
y=-20
if (x/y)>0 then print "x"
wait key

that gets rid of the abs() function which I think has an issue in dbc, but you have to make sure y is never 0 or you'll get an error

so the truth table will end up (x/y>0):
y<0 y=0 y>0
x<0 True Error False
x=0 False Error False
x>0 False Error True

compared to your original truth table (x/|x|=y/|y|):
y<0 y=0 y>0
x<0 True Error False
x=0 Error Error Error
x>0 False Error True

Login to post a reply

Server time is: 2026-06-09 15:43:27
Your offset time is: 2026-06-09 15:43:27