use of bitwise arithmetic in GEGL code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Is the use of such tricks discouraged for GEGL (because gfloats could
be doubles at some point?)

We can take the absolute value by setting the sign bit to zero:
// Example 13.24
float f;
*(int*)&f &= 0x7FFFFFFF; // set sign bit to zero

(From http://www.agner.org/optimize/optimizing_cpp.pdf)

Nicolas Robidoux
Universite Laurentienne
_______________________________________________
Gegl-developer mailing list
Gegl-developer@xxxxxxxxxxxxxxxxxxxxxx
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer

[Index of Archives]     [Yosemite News]     [Yosemite Photos]     [gtk]     [GIMP Users]     [KDE]     [Gimp's Home]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux