SCLS Foundation Math

Presentation

SCLS Foundamental Math contains some basics mathematical functions.

Mathematical functions

SCLS Foundamental Math contains some (C++) functions made to execute (mathematicals) functions.</br> It has functions used in the image handling, like the "paeth_function".

Functions

float paeth_function(float left, float above, float upper_left)

Apply the paeth function to the "left", "above" and "upper_left" value. See the W3 Consortium PNG website to have more informations about it.
This function was added in the version 0.1 and last edited in the version 0.1.

Get mathematicals datas

If you want to get datas about something mathematicly, without any functions, SCLS Foundamental Math allows it. This functions are not hard to code at all, but it's a gain of time to have them already coded in SCLS. You can normalize a value between two other values with "normalize_value". You can get the sign of a double with the "sign" function.

Functions

double normalize_value(double number, double min, double max)

Return the double "number" normalized between "min" and "max" both included. This function is very similar to the "mod" function. if max is tinier than min, the 2 values are swapped. If max - min = 0, 0 is returned.
This function was added in the version 0.1 and last edited in the version 0.1.

int sign(double number)

Return the sign of "number", -1 or 1.
This function was added in the version 0.1 and last edited in the version 0.1.

Code specification

This file define the macro "SCLS_FOUNDATION_MATH".