fuckingtech/public/assets/glsl/lygia/math/mod289.cuh
Elias Rhouzlane bf76c6b086 fix: code
2025-04-06 17:23:52 +02:00

18 lines
679 B
Text

#include "floor.cuh"
#include "operations.cuh"
/*
contributors: [Stefan Gustavson, Ian McEwan]
description: modulus of 289
use: <float|float2|float3|float4> mod289(<float|float2|float3|float4> x)
*/
#ifndef FNC_MOD289
#define FNC_MOD289
inline __device__ __host__ float mod289(float x) { return x - floor(x * (1.0f / 289.0f)) * 289.0f; }
inline __device__ __host__ float2 mod289(const float2& x) { return x - floor(x * (1.0f / 289.0f)) * 289.0f; }
inline __device__ __host__ float3 mod289(const float3& x) { return x - floor(x * (1.0f / 289.0f)) * 289.0f; }
inline __device__ __host__ float4 mod289(const float4& x) { return x - floor(x * (1.0f / 289.0f)) * 289.0f; }
#endif