// Copyright (c) 2021 Dominic Masters
// 
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

#pragma once

/**
 * Returns the modulous a result for b. Consdiders negative numbers correctly.
 * @param a Number to modulo against. (a % b)
 * @param b Number to modulo with. (a % b)
 */
#define mathMod(a,b)  (a%b+b)%b
#define mathMax(a,b)  (a<b?b:a)
#define mathMin(a,b)  (a>b?b:a)
#define mathAbs(n)    (n<0?-n:n)
#define mathDeg2Rad(n) (n * M_PI / 180.0)
#define mathRad2Deg(n) (n * 180 / M_PI)