When I run this commands, the output is zero!
set NstepGravity 10;
set DGravity [expr 1/$NstepGravity];
puts $DGravity;
to correct this (after an hour try and error!!!), I used 1. instead of 1, and the problem solved:
set NstepGravity 10;
set DGravity [expr 1./$NstepGravity];
puts $DGravity;
Why!?? Does any one knows about this role in TCL programming? Shall we always use (.) after integer numbers??
What is the source of this error in opensees?
Moderators: silvia, selimgunay, Moderators
Re: What is the source of this error in opensees?
it is integer math .. there have been many posts about it on the board .. always put a . after the number if it is double precision and you want to be safe when it comes to using the variable later in the script in mathematical expressions.