Scol standard library package
0.3.1
Common and usefull functions for all Scol applications
|
Functions | |
std_fClamp (f, startf, endf) | |
Clamp a float number in a range. More... | |
std_fCmp (f1, f2) | |
Compare two float numbers (depending of epsilon) More... | |
std_fDivide (f1, f2) | |
Perform a division between two float numbers The function returns a tuple : the result, the entire and the decimal parts of the result. More... | |
std_fEpsilonGet () | |
Get the 'epsilon' to compare deux floating point numbers. More... | |
std_fEpsilonSet (f) | |
Set the 'epsilon' to compare deux floating point numbers. More... | |
std_fInRange (f, startf, endf) | |
Return if a a float number in a range. More... | |
std_fIntDec (f) | |
Return the entire and the decimal parts of a float number. More... | |
std_fIsZero (f) | |
Return if a float number is near at zero (depending of epsilon) More... | |
std_vectorIsEqualF (v1, v2) | |
Return if two float vectors are equals. More... | |
Package to load : lib/std/float.pkg
std_fEpsilonGet | ( | ) |
Get the 'epsilon' to compare deux floating point numbers.
By default, this value is 0.000001
Prototype : : fun [] F
std_fEpsilonSet | ( | f | ) |
Set the 'epsilon' to compare deux floating point numbers.
By default, this value is 0.000001
Prototype : : fun [F] F
F | : a new 'epsilon' |
std_fIsZero | ( | f | ) |
Return if a float number is near at zero (depending of epsilon)
Prototype : : fun [F] I
F | : value to test |
std_fCmp | ( | f1 | , |
f2 | |||
) |
Compare two float numbers (depending of epsilon)
Prototype : : fun [F F] I
F | : a float number |
F | : another float number |
std_fInRange | ( | f | , |
startf | , | ||
endf | |||
) |
Return if a a float number in a range.
Prototype : : fun [F F F] I
F | : a float number |
F | : the bottom of the range (start) |
F | : the top of the range (end) |
std_fClamp | ( | f | , |
startf | , | ||
endf | |||
) |
Clamp a float number in a range.
Prototype : : fun [F F F] F
F | : a float number |
F | : the bottom of the range (start) |
F | : the top of the range (end) |
std_fIntDec | ( | f | ) |
Return the entire and the decimal parts of a float number.
Prototype : : fun [F] [I F]
F | : a float number |
std_fDivide | ( | f1 | , |
f2 | |||
) |
Perform a division between two float numbers The function returns a tuple : the result, the entire and the decimal parts of the result.
_fooS sprintf "%f %i %f" std_fDivide 10.25 5.0; // 2,050000 2 0,050000
Prototype : : fun [F] [F I F]
F | : a float number |
std_vectorIsEqualF | ( | v1 | , |
v2 | |||
) |
Return if two float vectors are equals.
Prototype: fun [[F F F] [F F F]] I
[F | F F] : first float vector |
[F | F F] : second float vector |