summaryrefslogtreecommitdiff
path: root/src/glm/gtx/ulp.hpp
blob: 0c607185f377eb9063732fecfa4cd8ff5771f398 (plain)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2011-02-21
// Updated : 2009-02-21
// Licence : This source is under MIT License
// File    : glm/gtx/ulp.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
// Dependency:
// - GLM core
///////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef glm_gtx_ulp
#define glm_gtx_ulp

// Dependency:
#include "../glm.hpp"

#if(defined(GLM_MESSAGES) && !defined(glm_ext))
#	pragma message("GLM: GLM_GTX_ulp extension included")
#endif

namespace glm{
namespace gtx{
namespace ulp ///< GLM_GTX_ulp extension: Precision calculation functions
{
	/// \addtogroup gtx_ulp
	/// @{

	//! Return the next ULP value(s) after the input value(s).
	//! From GLM_GTX_ulp extension.
    template <typename genType>
    genType next_float(genType const & x);
        
	//! Return the previous ULP value(s) before the input value(s).
	//! From GLM_GTX_ulp extension.
    template <typename genType>
    genType prev_float(genType const & x);

	//! Return the value(s) ULP distance after the input value(s).
	//! From GLM_GTX_ulp extension.
    template <typename genType>
    genType next_float(genType const & x, uint const & Distance);
        
    //! Return the value(s) ULP distance before the input value(s).
	//! From GLM_GTX_ulp extension.
    template <typename genType>
    genType prev_float(genType const & x, uint const & Distance);
        
    //! Return the distance in the number of ULP between 2 scalars.
	//! From GLM_GTX_ulp extension.
    template <typename T>
    uint float_distance(T const & x, T const & y);
        
    //! Return the distance in the number of ULP between 2 vectors.
	//! From GLM_GTX_ulp extension.
    template<typename T, template<typename> class vecType>
    vecType<uint> float_distance(vecType<T> const & x, vecType<T> const & y);
        
	///@}
}// namespace ulp
}// namespace gtx
}// namespace glm

#include "ulp.inl"

namespace glm{using namespace gtx::ulp;}

#endif//glm_gtx_ulp