tcl foreach - integer?

Forum for OpenSees users to post questions, comments, etc. on the use of the OpenSees interpreter, OpenSees.exe

Moderators: silvia, selimgunay, Moderators

Post Reply
Marco Faggella 2
Posts: 29
Joined: Fri May 13, 2005 5:36 am

tcl foreach - integer?

Post by Marco Faggella 2 »

Silvia, Frank, users

why does tcl treat my parameters as integers when I use foreach? the result of the expression epsc0 returns zero instead of 0.00195

foreach {fc Es } {
31 31736 ....
set epsc0 [expr 2*$fc/$Ec]

how can I evaluate that rational while keeping using foreach?

thanks
m.
Marco Faggella
Ph.D. student
Univ. Chieti-Pescara, Italy
UC San Diego
Marco Faggella 2
Posts: 29
Joined: Fri May 13, 2005 5:36 am

Post by Marco Faggella 2 »

... ok

I added .0 and it works

31.0 31736.0

thanks anyway

m.
Marco Faggella
Ph.D. student
Univ. Chieti-Pescara, Italy
UC San Diego
Post Reply