|
| PMReal | ToPMReal (Fixed fx) |
| |
| double | ToDouble (const PMReal &r) noexcept |
| |
| float | ToFloat (const PMReal &r) |
| |
| Fixed | ToFixed (const PMReal &r) |
| |
| int16 | ToInt16 (const PMReal &r) |
| |
| uint16 | ToUInt16 (const PMReal &r) |
| |
| int32 | ToInt32 (const PMReal &r) |
| |
| uint32 | ToUInt32 (const PMReal &r) |
| |
| PMReal | operator- (const PMReal &a) |
| |
| PMReal | operator+ (const PMReal &a, const PMReal &b) |
| |
| PMReal | operator- (const PMReal &a, const PMReal &b) |
| |
| PMReal | operator* (const PMReal &a, const PMReal &b) |
| |
| PMReal | operator/ (const PMReal &a, const PMReal &b) |
| |
| PMReal | Round (const PMReal &a) |
| |
| PMReal | Floor (const PMReal &a) |
| |
| PMReal | Ceiling (const PMReal &a) |
| |
| PMReal | abs (const PMReal &a) |
| |
| PMReal | NearestMultiple (const PMReal &a, const PMReal &factor) |
| |
| PMReal | Mod (const PMReal &a, const PMReal &b) |
| |
| bool16 | operator== (const PMReal &a, const PMReal &b) noexcept |
| |
| bool16 | operator!= (const PMReal &a, const PMReal &b) noexcept |
| |
| bool16 | operator< (const PMReal &a, const PMReal &b) noexcept |
| |
| bool16 | operator> (const PMReal &a, const PMReal &b) noexcept |
| |
| bool16 | operator<= (const PMReal &a, const PMReal &b) noexcept |
| |
| bool16 | operator>= (const PMReal &a, const PMReal &b) noexcept |
| |
| bool16 | AnglesEqual (const PMReal &a, const PMReal &b) noexcept |
| |
| bool16 | EqualsWithEpsilon (const PMReal &a, const PMReal &b, double epsilon) noexcept |
| |
Simple wrapper class for a floating point value in InDesign. Analogous to a built-in C/C++ double.
NOTE: Implicit type casting
Implicit type casting has not been added to PMReal on purpose. Leaving out implicit type casting allows the compiler to make unambigous choices for math operations containing mixed types. Additionally, implicit type casting can be hazardous to your coding health, so instead we have provided explicit functions for conversion.
NOTE: Constructor conversions
We only have one constructor taking a double to avoid ambiguous calls. This does mean that implicit conversion happens when going to a PMReal. Be careful in your code. To make the class at all useable it had to implicit conversion one direction or the other and we chose the constructor.
NOTE: Why a class?
Why are we using a class and not a double? Primarily to hide the epsilon comparisons behind operator definitions. It may also help us out in the future if we have to add anything – It will be easier to add to this class than change from a typedef.