Mercurial > hg > octave-lyh
changeset 17463:b76b14e386b3
Replace ambiguous call to pow with bit shift
* __magick_read__.cc (encode_uint_image<T>): Replace ambiguous call to pow
with bit shift for computing integer powers of two.
author | Mike Miller <mtmiller@ieee.org> |
---|---|
date | Fri, 20 Sep 2013 18:43:43 -0400 |
parents | 36877a45bd1b |
children | 2c2a6801cb57 |
files | libinterp/dldfcn/__magick_read__.cc |
diffstat | 1 files changed, 1 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/dldfcn/__magick_read__.cc +++ b/libinterp/dldfcn/__magick_read__.cc @@ -27,8 +27,6 @@ #include <config.h> #endif -#include <cmath> - #include "file-stat.h" #include "oct-env.h" #include "oct-time.h" @@ -1035,7 +1033,7 @@ // From GM documentation: // Color arguments are must be scaled to fit the Quantum size according to // the range of MaxRGB - const double divisor = (pow (2, bitdepth) - 1) / MaxRGB; + const double divisor = static_cast<double>((1 << bitdepth) - 1) / MaxRGB; const P *img_fvec = img.fortran_vec (); const P *a_fvec = alpha.fortran_vec ();