Jacl 1.1.1 prints out the wrong number when trying to handle NaN

cxh@carson 50% uname -a
SunOS carson.eecs.berkeley.edu 5.5.1 Generic_103640-24 sun4u sparc SUNW,Ultra-2
cxh@carson 51% java -version
java version "1.2"
Classic VM (build JDK-1.2-V, green threads, sunwjit)
cxh@carson 52% setenv CLASSPATH jacl.jar:tcljava.jar 
cxh@carson 53% java tcl.lang.Shell
% java::field java.lang.Double NaN
2147483647.21474836472147483647214748364721474836472147483647214748364721474836472147483647214748364721474836472147483647
% set java::patchLevel
1.1.1
% 

The fix is to modify
src/jacl/tcl/lang/FormatCmd.java:

***************
*** 683,688 ****
--- 683,691 ----
         */
  
        exp = 0;
+       if ((new Double(dblValue)).isNaN()) {
+             return "NaN";
+         }
        if (dblValue>0.0) {
            int k = 0;
            while ((dblValue >= 1e8) && (k++ < 100)) {

-Christopher

----------------------------------------------------------------
The TclJava mailing list is sponsored by WebNet Technologies.
To subscribe:    send mail to [EMAIL PROTECTED]  
                 with the word SUBSCRIBE as the subject.
To unsubscribe:  send mail to [EMAIL PROTECTED] 
                 with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'. 
A list archive is at: http://www.findmail.com/listsaver/tcldallas/

Reply via email to