@charset "UTF-8";

// @description
// * is-float function.
// * This module provides a function to check if the argument is
// * a floating-point number.

// @access public

// @version 1.5.0

// @author Khaled Mohamed

// @license MIT

// @repository: https://github.com/Black-Axis/sass-pire

// @namespace type-checks

// @module type-checks/is-float

// @dependencies:
// * - meta.type-of (SASS function).
// * - LibFunc.cut-unit (function).
// * - Error.throw (function).

// @param {number} $val
// * A number to check if it is a floating-point
// * number or not.

// @throw {string}
// * You must pass an argument with number type to the
// * is-float function.

// @example
// * .example {
// *   content: is-float(12.66deg);
// * }

// @output
// * .example {
// *   content: true;
// * }

// @returns {boolean} - True if it is a floating-point number,
// * false if not.

@use "sass:meta";
@use "sass:math";
@use "../../functions/global/cut-unit" as LibFunc;
@use "../../development-utils/toggle-error-message" as Error;

@function is-float($value) {
    @if meta.type-of($value) != number {
        @return Error.throw("The parameter of is-float function must be in a number type.");
    }

    $flag: false;
    $actual-number: LibFunc.cut-unit($value);

    @if $actual-number % 1 != 0 {
        $flag: true;
    }

    @return $flag;
}
