I think it's a bug.
Jmol.___JmolVersion="14.3.13_2015.04.02"
bug fix: [3 4 5].min should give integer 3, not decimal 3.0 (same with .max)
On Thu, Apr 2, 2015 at 7:08 PM, Robert Hanson <hans...@stolaf.edu> wrote:
> Good point - yes, it does return a decimal every time. Could look into
> that.
>
> On Thu, Apr 2, 2015 at 11:33 AM, Rolf Huehne <rhue...@fli-leibniz.de>
> wrote:
>
>> Hi all,
>>
>> in Jmol 14.3.13_2015.04.01b the minimum and maximum modifier functions
>> '.min' and '.max' change unexpectedly (at least for me) the type of the
>> result for integer variables to decimal.
>>
>> --- Examples -----------
>> function minMaxTest(x, y) {
>> var minValue = [x, y].min;
>> var maxValue = [x, y].max;
>> print "x=" + x + "; xType=" + x.type;
>> print "y=" + y + "; yType=" + y.type;
>> print "minValue=" + minValue + "; minValueType=" + minValue.type;
>> print "maxValue=" + maxValue + "; maxValueType=" + maxValue.type;
>> print "-----";
>> }
>> minMaxTest(1, 2);
>> minMaxTest(1.0, 2.0);
>> minMaxTest("1", "2");
>> minMaxTest("1",2.0)
>>
>> --- Example Output -----
>> x=1; xType=integer
>> y=2; yType=integer
>> minValue=1.0; minValueType=decimal
>> maxValue=2.0; maxValueType=decimal
>> -----
>> x=1.0; xType=decimal
>> y=2.0; yType=decimal
>> minValue=1.0; minValueType=decimal
>> maxValue=2.0; maxValueType=decimal
>> -----
>> x=1; xType=string
>> y=2; yType=string
>> minValue=1.0; minValueType=decimal
>> maxValue=2.0; maxValueType=decimal
>> -----
>> x=1; xType=string
>> y=2.0; yType=decimal
>> minValue=1.0; minValueType=decimal
>> maxValue=2.0; maxValueType=decimal
>> -----
>> ------------------------
>>
>> It looks like it is intended that the result is always decimal.
>> If this is the case I would recommend to mention this in the scripting
>> documentation, since it is not obvious to everyone for a set of integer
>> values.
>>
>> Regards,
>> Rolf
>>
>> --
>>
>> Rolf Huehne
>> Postdoc
>>
>> Leibniz Institute for Age Research - Fritz Lipmann Institute (FLI)
>> Beutenbergstrasse 11
>> 07745 Jena, Germany
>>
>> Phone: +49 3641 65 6205
>> Fax: +49 3641 65 6210
>> E-Mail: rhue...@fli-leibniz.de
>> Website: http://www.fli-leibniz.de
>>
>> Scientific Director: Prof. Dr. K. Lenhard Rudolph
>> Head of Administration: Dr. Daniele Barthel
>> Chairman of Board of Trustees: Dennys Klein
>>
>> VAT No: DE 153 925 464
>> Register of Associations: No. 230296, Amtsgericht Jena
>> Tax Number: 162/141/08228
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Dive into the World of Parallel Programming The Go Parallel Website,
>> sponsored
>> by Intel and developed in partnership with Slashdot Media, is your hub
>> for all
>> things parallel software development, from weekly thought leadership
>> blogs to
>> news, videos, case studies, tutorials and more. Take a look and join the
>> conversation now. http://goparallel.sourceforge.net/
>> _______________________________________________
>> Jmol-users mailing list
>> Jmol-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>
>
>
>
> --
> Robert M. Hanson
> Larson-Anderson Professor of Chemistry
> Chair, Department of Chemistry
> St. Olaf College
> Northfield, MN
> http://www.stolaf.edu/people/hansonr
>
>
> If nature does not answer first what we want,
> it is better to take what answer we get.
>
> -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
>
>
--
Robert M. Hanson
Larson-Anderson Professor of Chemistry
Chair, Department of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr
If nature does not answer first what we want,
it is better to take what answer we get.
-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users