[kepler-dev] Token.toString method(s)
higgins at nceas.ucsb.edu
Sat Feb 25 11:39:43 PST 2006
Good point - NaN is a legitimate result. With a simple Double token you
can tell whether toString should return nil from the isNil() method.
With a DoubleMatrix, we should probably print 'NaN' unless we can keep a
'shadow list' that could distinguish between 'nil' settings and NaN
Edward A. Lee wrote:
> At 03:27 PM 2/24/2006, Christopher Brooks wrote:
>> I started looking at DoubleMatrixToken, but one issue is that
>> the underlying data type is a Java double, so I'd have to
>> keep a shadow list of nil tokens to make toString() print
>> nil instead of NaN. Right now, it is possible to create
>> a DoubleMatrix with [1.0, 2.0 ; 3.0,nil], but this is printed as
>> [1.0, 2.0; 3.0, NaN].
> I don't think we should print NaN as nil...
> The problem is that a DoubleMatrixToken might be a result
> of some numerical calculation, and NaN is a legitimate result.
> I think it's fine to represent nil as NaN, but I think it should
> still print as NaN.
> Edward A. Lee
> Professor, Chair of the EE Division, Associate Chair of EECS
> 231 Cory Hall, UC Berkeley, Berkeley, CA 94720
> phone: 510-642-0253 or 510-642-0455, fax: 510-642-2845
> eal at eecs.Berkeley.EDU, http://ptolemy.eecs.berkeley.edu/~eal
More information about the Kepler-dev