Skip to main content

luaur_compiler/functions/
cnum.rs

1use crate::enums::type_constant_folding::Type;
2use crate::records::constant::Constant;
3
4pub(crate) fn cnum(v: f64) -> Constant {
5    let mut res = Constant {
6        r#type: Type::Type_Number,
7        string_length: 0,
8        data: unsafe { core::mem::zeroed() },
9    };
10
11    unsafe {
12        res.data.value_number = v;
13    }
14
15    res
16}