|
QGIS API Documentation 3.99.0-Master (21b3aa880ba)
|
Contains utility functions for mathematical operations. More...
#include <qgsmathutils.h>
Static Public Member Functions | |
| static Q_INVOKABLE void | doubleToRational (double value, qlonglong &numerator, qlonglong &denominator, double tolerance=1.0e-9, int maxIterations=100) |
| Converts a double value to a rational fraction. | |
Contains utility functions for mathematical operations.
Definition at line 29 of file qgsmathutils.h.
|
static |
Converts a double value to a rational fraction.
| value | value to convert |
| numerator | calculated numerator |
| denominator | calculated denominator |
| tolerance | desired precision. The returned fraction will be at within this tolerance of the original value. |
| maxIterations | maximum number of iterations. Higher values result in better approximations, but at the cost of additional computation. |
Definition at line 23 of file qgsmathutils.cpp.