What is the source of this error in opensees?

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

Moderators: silvia, selimgunay, Moderators

Post Reply
radmard
Posts: 9
Joined: Mon Jun 22, 2015 11:51 am
Location: Bauhaus University

What is the source of this error in opensees?

Post by radmard »

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??
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: What is the source of this error in opensees?

Post by fmk »

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.
Post Reply