libft
Loading...
Searching...
No Matches
Functions
math_utils.c File Reference

Utility math functions for floating-point operations. More...

#include "libft.h"
+ Include dependency graph for math_utils.c:

Functions

double clamp (double value, double min, double max)
 Clamps a value between a minimum and maximum.
 
double get_fractional_part (double value)
 Gets the fractional part of a floating-point number.
 
double wrap_in_range (double value, double range)
 Wraps a value within the range [0, range).
 

Detailed Description

Utility math functions for floating-point operations.

Author
Toonsa
Date
2025-04-05

This file provides generic math utilities such as clamping values, extracting fractional parts, and wrapping values within ranges. These functions are commonly used in mathematical computations, rendering systems, and game development logic.