Fatal: Syntax error, ")"expected but identifier found [closed] - freepascal

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 4 years ago.
Improve this question
TOTAL [X] :=
(0.1 tomat*harga tomat ) + (0.2 cabe*harga cabe) + (0.3 kol*harga kol)+
(0.4 ikan*hargaikan)+ (0.5 tahun*hargatahu) + (0.6 tahu*harga tahu);

Each of the six sub expressions has syntax errors. For instance
0.1 tomat*harga tomat
You can't omit operators like you do in maths. So perhaps what you meant is
0.1 * tomat * harga * tomat
Or perhaps harga tomat is meant to be a single variable. Variable names cannot contain spaces. So you'd need to rename it without a space.

Related

I don't understand why my 8.6 tcl version does understand a for loop like this: "for{set i 0}{$i<10}{incr i}{ [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 9 days ago.
Improve this question
I am using the tclsh interpreter and the Synopsis Primetime shell. Both are not supporting that kind of loop. is there something that I am missing here?
Thanks a lot
I am trying to perform a very standard for loop
I think you just a syntax error. This works for me:
for {set x 0} {$x<10} {incr x} {
puts "x is $x"
}
Outputs:
x is 0
x is 1
x is 2
x is 3
x is 4
x is 5
x is 6
x is 7
x is 8
x is 9

Octave - How to plot an "infinite"(= Defining the function on [0:35916] for me) sawtooth function [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 4 years ago.
Improve this question
I know how to plot a sawtooth function (thanks to another forum) but only on the domain [0:10] thanks to the following code which is actually working :
t=0:0.04:10;
A=1;
T=1;
rho= mod(t * A / T, A);
plot(t,rho)
A=the amplitude, T=the period,t=the time interval.
The problem is that I need the same function on the domain [0:35916] but when I try to adapt this code to do so (eg by extending the time interval), I get an error and I don't understand why.
error:
plt2vv: vector lengths must match error: called from plt>plt2vv at line 487 column 5 plt>plt2 at line 246 column 14 plt at line 113 column 17 plot at line 222 column 10
Simply modifying the original upper limit of your interval from 10 to 35916 should do the trick:
t=0:0.04:35916;
A=1;
T=1;
rho= mod(t * A / T, A);
plot(t,rho)
The code above yields the following image:
Of course it is up to you to adjust A and T to suit your needs.

Wy decimal numbers are not stored as expected in mysql [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I'm trying to save numbers in decimal data type filed formated (10,4), but it's not stored as expected ie. 13850 changed to 13.0000 any help.
this is my code:
$c_price = $unit_price*$rate;
$expense->c_price = number_format($c_price, 4);
$expense->c_total = number_format($quantity*$c_price, 4);
Here c_price and c_total values are changed.
Increase the length of digits:
(19,4)
it will work.

how to design grid and blocks in cuda fortran for a 3-d array [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
I am new to Cuda fortran. I have never worked with higher dimension grids. I just thought to start with this problem, in which i have to assign 1 thread to each cell of a 3-d array of size 46*46*19. Please can someone help me how to design the grid and blocks for this type of array and to compute the thread indices for that.
any help will be appreciated.
I have come up with this, but i don't know how to compute the thread indexes
type(dim3) :: threads,blocks
threads=dim3(16,16,4)
blocks=dim3((xDim + threads%x - 1)/threads%x,(yDim + threads%y - 1)/threads%y,(zDim + threads%z - 1)/threads%z)
The code you've shown in your question is what you would use to set up the kernel launch.
Inside the kernel you could use code like this to generate thread x,y, and z indices:
idx = (blockIdx%x-1) * blockDim%x + threadIdx%x-1
idy = (blockIdx%y-1) * blockDim%y + threadIdx%y-1
idz = (blockIdx%z-1) * blockDim%z + threadIdx%z-1
This would create zero-based indexing. You could omit the -1 at the end of each line of code above to create one-based indexing.

ROUND IN SQL Works but for this case what to do in MYSQL [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I need to round the decimals like :
1.00 ->1.0
1.987->1.98
1.93-> 1.93
1.07->1.07
How to do this in mysql?
Here goes some documentation
http://dev.mysql.com/doc/refman/5.0/en/mathematical-functions.html#function_round
Quick answer:
mysql> SELECT ROUND(1.987, 2); = 1.99
OR More what you are looking for
truncate(1.987, 2) = 1.98
From Mysql decimal: floor instead of round
This only makes a difference if you are outputting the number (numerically, 1.0 = 1.00). So:
(case when format(num, 2) = '1.00' then '1.0' else format(num-0.005, 2) end)
The -0.005 is to overcome the fact that format() rounds rather than truncates.
Just like that:
SELECT if(NUMBER mod 1=0,ROUND(NUMBER,1),ROUND(NUMBER,2));
eg.
SELECT IF(1.00 MOD 1=0,ROUND(1.00,1),ROUND(1.00,2)); => 1.0
more info