possible bug -fx calc with scientific notation

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

possible bug -fx calc with scientific notation

Post by fmw42 »

IM 6.7.8.2 Q16 Mac OSX Snow Leopard

The following fx calculation does not seem to working with scientific notation. Correct me if I am wrong, but this was fixed some time ago. I assume it got lost somewhere along the way.

2011-05-21 6.7.0-0 Cristy <quetzlzacatenango@image...>
...
Fix -fx to interpret scientific notation properly.


val=2.44141e-05
convert xc: -format "%[fx:round(255*$val)]" info:
311

Should round to zero, right?

convert xc: -format "%[fx:round(255*2.44141e-05)]" info:
311
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: possible bug -fx calc with scientific notation

Post by magick »

Right. A bug. Will have a fix within a day or two.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug -fx calc with scientific notation

Post by fmw42 »

magick wrote:Right. A bug. Will have a fix within a day or two.
Thanks. Let me know when available in the beta and I will verify it.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: possible bug -fx calc with scientific notation

Post by magick »

Try Beta now.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug -fx calc with scientific notation

Post by fmw42 »

magick wrote:Try Beta now.
The list of betas still show as 2 days old.

ImageMagick-6.7.8-4.tar.bz2 16-Jul-2012 09:16
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: possible bug -fx calc with scientific notation

Post by magick »

Building now...
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug -fx calc with scientific notation

Post by fmw42 »

magick wrote:Building now...

Thanks. It is fixed in IM 6.7.8.4 Q16 beta:


This works again.

imb convert xc: -format "%[fx:round(255*2.44141e-05)]" info:
0


This also works:

imb convert xc: -precision 10 -format "%[fx:1e+6]" info:
1000000
Post Reply