NumCpp
2.1.0
A C++ implementation of the Python Numpy library
binaryRepr.hpp
Go to the documentation of this file.
1
#pragma once
30
31
#include "
NumCpp/Core/DtypeInfo.hpp
"
32
#include "
NumCpp/Core/Internal/StaticAsserts.hpp
"
33
34
#include <bitset>
35
#include <string>
36
37
namespace
nc
38
{
39
//============================================================================
40
// Method Description:
49
template
<
typename
dtype>
50
std::string
binaryRepr
(dtype inValue)
51
{
52
STATIC_ASSERT_ARITHMETIC
(dtype);
53
54
return
std::bitset<DtypeInfo<dtype>::bits()>(inValue).to_string();
55
}
56
}
// namespace nc
StaticAsserts.hpp
STATIC_ASSERT_ARITHMETIC
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition:
StaticAsserts.hpp:38
nc::binaryRepr
std::string binaryRepr(dtype inValue)
Definition:
binaryRepr.hpp:50
nc
Definition:
Coordinate.hpp:45
DtypeInfo.hpp
include
NumCpp
Functions
binaryRepr.hpp
Generated by
1.8.17