SRL Archive - General

x := unknown?


Jason2gs

2007-04-18 17:15:09

I've been doing some experimenting with SCAR, and I wanted to know if it was possible to have a variable's value unknown.

Can't really delve deeper than that, sorry.

Please answer, ;)

Mike.

Smartzkid

2007-04-18 17:27:39

kinda like when you make a string equal '' (< that's two single quotes)?

Jason2gs

2007-04-18 17:35:55

I haven't tested strings yet, but I do know that integers are equal to zero.

Like with algebra, the x is unknown, you have to figure it out.

Smartzkid

2007-04-18 17:48:22

ooo I remember trying to brute force equations on my TI last year…they're too slow for it, though…especially if the answer can have decimals

I don't understand why you need the x to be unknown though?

Ejjman

2007-04-18 19:31:12

x = 0 will work.

Before you solve an equation, x always starts at zero


5x = 10

divide the 5

x = 2

;)

Jason2gs

2007-04-18 20:49:11

From: Ejjman1
x = 0 will work.

Before you solve an equation, x always starts at zero


5x = 10

divide the 5

x = 2

;)


x = 0 will make x = 0

If, in the equation, you have to multiply the x by two, and the x's value was, say, five, the answer would be ten. Using SCAR, you'd end up with zero as the answer.

(Zero times anything equals zero)

Cheesehunk

2007-04-18 23:02:47

You can use null in SCAR, but I have not been able too create a relationship between integers and null. The weird thing is, you can compare integer's no null, but not strings, etc.. However, I don't know how to make the actual integer;s value null.

program New;
var x: Integer;
S: String;

begin
if (x = null) then
WriteLn('True')
else writeln('False');
if (null = null) then
WriteLn('True')
else writeln('False');
if (s = nul) then
WriteLn('True')
else writeln('False');
end.