You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
565 B
C++

/*------------------------------------------------------------------------------
* Copyright (c) 2023 by Bai Bing (seread@163.com)
* See COPYING file for copying and redistribution conditions.
*
* Alians IT Studio.
*----------------------------------------------------------------------------*/
#pragma once
#include <algorithm>
#include <execution>
#include "core/StaticAsserts.h"
namespace ais
{
template <typename dtype>
constexpr dtype sqr(dtype x) noexcept
{
STATIC_ASSERT_ARITHMETIC_OR_COMPLEX(dtype);
return x * x;
}
}