Files
core_math/tjp/core/math/Zero.h
Timothy Prepscius 0807c0286a flatten 20260225
2026-02-25 12:36:47 -05:00

34 lines
390 B
C++
Executable File

//
// Math.hpp
// amoeba
//
// Created by Timothy Prepscius on 12/30/16.
// Copyright © 2016 Timothy Prepscius. All rights reserved.
//
#pragma once
namespace tjp::core::math {
template<typename T>
void zero(T &t)
{
t = T{0};
}
template<typename T>
T zero()
{
T t;
zero(t);
return t;
}
template<typename T>
bool is_zero(const T &t)
{
return t == zero<T>();
}
} // namespace