What is Calq?
Bugs in Calq
When bugs are found, this page will document them.
This page may also include items that are not necessarily bugs, but
future enhancements.
-
Some functions (atan, acos, asin) do not support matrices of complex numbers.
Also, complex number to a power is not implemented,
and matrix division does not work unless it is element-by-element.
These are not bugs so much as incomplete specifications.
Status: unresolved, low priority
atan([ 0.4+5j, -0.4 ])
This produces the alert:
Sorry, atan does not yet work for complex
- The + has different contexts within the disp statement.
Status: unresolved, low priority
a = 4;
b = 3;
disp('hello ' + a + b);
disp(a + b + ' hello');
This produces the output:
hello 4 3
7 hello
A work-around is to build the string in two steps.
a = 4;
b = 3;
s = b + ' hello';
disp(a + s);
- Calq does not print the variable name in assignments,
when there is no semi-colon.
Status: unresolved, low priority
a = 4
On version 2.1.7, this produces the output:
4
Should this instead indicate the variable name? Such as:
a =
4
- Problem starting numbers with a decimal point.
Status: resolved in v2.1.7
.7 / 2.2 % generates an error: expecting an operator instead of symbol
The parser is picky about starting numbers with a decimal.
I thought I had fixed this previously, but the version
(2.1.5, as of July 2010) has this problem.
A simple work-around is to put a 0 before the decimal, like below.
0.7 / 2.2 % works.
This is fixed and no longer a problem as of v2.1.7.
- Displaying strings
Status: resolved in v2.1.6
a = 4;
disp('hello ' + a);
disp(a + ' hello');
This produces the following output (v2.1.5 and before):
hello
4 hello
This should produce the following output:
hello 4
4 hello
- A variable defined as a string, then redefined, is later thought to be
a string.
Status: resolved in v2.1.7
For example, the code below generates the message
"Error: How can you subtract a string?"
a = 'hello';
a = 3*j
b = 1-a
Here's another way to see it.
a = 3*j
disp(a)
This generates the output:
0 + 3i
hello
What happened? There was an "old" way to determine strings internally,
and it was used here. But the flag used to mark a string variable
was not consistently set.
The new way uses the internal variable type value to determine if it
is a string, so it should work properly now (v2.1.7).
- acos function returns a weird character.
Status: resolved in v2.1.7
For example, the code below generates a character that looks like a black
diamond with a white question mark in the center.
acos(2)
First of all, the parameter to the acos function should be between -1 and
1. acos(2) generates a special value Not-a-Number (NaN) result.
When printed, this may appear as "NaN" or the inverted question mark.
The code was changed to consistently print it as "NaN."
-
Leaving out the commas between list entries produces an error.
Status: resolved in v2.1.7
For example, the code below generates an error for line 2,
even though line 1 works.
y = [ 1, 2, 3, 4]
x = [ 1 2 3 4 ]
The error is "[ number 1 number 2 number 3 number 4 ]
expecting an operator instead of number 1."
Since this is a notational convenience, it is not high on the priority
list of things to fix. It was designed to work with commas between the
numbers, though it would be nice to allow it to work without commas.
-
The semi-colon suppresses output, but it does not allow multiple commands
to share a line.
Status: resolved in v2.1.7
For example, the code below generates an error that
"Variable x does not exist."
x = 3; x=x*2; disp(x);
Breaking it up into two lines gives the error "number 6 ; disp number 3
expecting an operator instead of number 6."
x = 3;
x=x*2; disp(x);
If the three commands appear on separate lines, then it works.
Here is another test case:
[1;2]
[3,4]
y = 2; x = 4
- Starting a for loop with a negative number
Status: resolved in v2.1.7
The code below generates the error "expects an operator instead of =."
Without the minus-sign, it works fine.
for m=-0.2:0.1:0.2
disp('loop index is ' + m);
end
The minus-sign seems to be the cause of the confusion. There are two
ways to make this work. Here is one:
a = -0.2;
for m=a:0.1:0.2
disp('loop index is ' + m);
end
and this works as stated below...
for m=(-0.2):0.1:0.2
disp('loop index is ' + m);
end
- Putting a string on a line by itself generates a warning.
Status: resolved in v2.1.7
The code below generates an "ignoring item string hello" message.
'hello'
This is somewhat inconsistent, since another value
(such as entering 3 on a line by itself)
would simply copy the
value to the output without generating a warning.
- 4j does not work. 4*j does. So to specify a complex number,
you must currently type 3+4*j instead of 3+4j
Status: resolved in v2.1.7
- The size function does not work.
Status: resolved in v2.1.7
d = [1, 2, 3, 5];
length(d)
size(d)
This is the output that it produces.
4
0 0
The size function is an extension of the length function.
It will be needed in the future, if/when matrices are supported.
It should return 1 for the rows and length() for the columns,
i.e. 1 4 in this example.
[Note for v2.1.7: this was an easy thing to fix.]
Have you found a bug?
If so, e-mail me at the address below.
Please put "Calq" in the subject line so that my spam checker will not
discard your e-mail. Also, copy and paste the code (your input) into the
email, so that I can see the bug.