1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
use crate::callable::QalamCallable;
use crate::error::RuntimeError;
use crate::interpreter::Interpreter;
use crate::literal::Literal;
use crate::token::Token;
use ordered_float::OrderedFloat;
use rand::Rng;
pub mod array_constructor;
pub mod ceil;
pub mod clock;
pub mod code;
pub mod floor;
pub mod indexof;
pub mod len;
pub mod max;
pub mod min;
pub mod num;
pub mod pop;
pub mod pow;
pub mod push;
pub mod random;
pub mod random_int;
pub mod replace;
pub mod round;
pub mod slice;
pub mod str;
pub mod substr;
pub mod typeof_func;
pub fn is_neg(num: f64) -> bool {
return num < 0.0;
}
pub fn is_int(num: f64) -> bool {
return num.fract() == 0.0;
}
pub fn is_usize(num: f64) -> bool {
if is_neg(num) {
return false;
}
if !is_int(num) {
return false;
}
return true;
}