File size: 1,217 Bytes
a93901d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#define GLM_ENABLE_EXPERIMENTAL
#include <glm/gtx/log_base.hpp>
#include <glm/gtc/vec1.hpp>
#include <glm/gtc/epsilon.hpp>
#include <glm/exponential.hpp>

namespace test_log
{
	int run()
	{
		int Error = 0;

		{
			float A = glm::log(10.f, 2.0f);
			float B = glm::log2(10.f);
			Error += glm::epsilonEqual(A, B, 0.00001f) ? 0 : 1;
		}

		{
			glm::vec1 A = glm::log(glm::vec1(10.f), glm::vec1(2.0f));
			glm::vec1 B = glm::log2(glm::vec1(10.f));
			Error += glm::all(glm::epsilonEqual(A, B, glm::vec1(0.00001f))) ? 0 : 1;
		}

		{
			glm::vec2 A = glm::log(glm::vec2(10.f), glm::vec2(2.0f));
			glm::vec2 B = glm::log2(glm::vec2(10.f));
			Error += glm::all(glm::epsilonEqual(A, B, glm::vec2(0.00001f))) ? 0 : 1;
		}

		{
			glm::vec3 A = glm::log(glm::vec3(10.f), glm::vec3(2.0f));
			glm::vec3 B = glm::log2(glm::vec3(10.f));
			Error += glm::all(glm::epsilonEqual(A, B, glm::vec3(0.00001f))) ? 0 : 1;
		}

		{
			glm::vec4 A = glm::log(glm::vec4(10.f), glm::vec4(2.0f));
			glm::vec4 B = glm::log2(glm::vec4(10.f));
			Error += glm::all(glm::epsilonEqual(A, B, glm::vec4(0.00001f))) ? 0 : 1;
		}

		return Error;
	}
}//namespace test_log

int main()
{
	int Error(0);

	Error += test_log::run();

	return Error;
}