Files
dorayme/source/math_helper.cpp
Godzil 9f2a41e6f3 Change default precision to float instead of double (need to investigate there)
Also add a way to dynamically change the precision (needed for some test that don't use non full precision result matrix)
2020-02-14 19:18:43 +00:00

25 lines
413 B
C++

/*
* DoRayMe - a quick and dirty Raytracer
* Math helping functions
*
* Created by Manoël Trapier
* Copyright (c) 2020 986-Studio.
*
*/
#include <math.h>
#include <float.h>
#include <math_helper.h>
static double current_precision = FLT_EPSILON;
void set_equal_precision(double v)
{
current_precision = v;
}
bool double_equal(double a, double b)
{
return fabs(a - b) < current_precision;
}