Forum OpenACS Development: Re: complex survey datamodel suggestion/question

Collapse
Posted by Cathy Sarisky on
Real or double can satisfactorily hold the student's answer, provided we don't care about being able to echo back the student's answer exactly as typed.  If, however, we want to know whether the student typed 6.02x10<sup>23</sup> or 6.020x10<sup>23</sup>, stuffing it into either type of column will result in it being converted to 602000000000000000000000.  And, in the event that we want to do some math on it in tcl despite plans to push everything to the database:

% set big 6.02e23
6.02e23
% set answer 6.01e23
6.01e23
% expr $answer/$big
0.998338870432

% set big 6020000000000000000000
6020000000000000000000
% set answer $big
6020000000000000000000
% expr $big/$answer
integer value too large to represent

Collapse
Posted by Guan Yang on
Use Mpexpr? 😉