std_mel/types/float.rs
1use melodium_macro::mel_function;
2
3/// Return the positive infinity for floating type.
4#[mel_function(
5 generic F (Float)
6)]
7pub fn infinity() -> F {
8 let f = generics.get("F").unwrap();
9
10 f.float_infinity()
11}
12
13/// Return the negative infinity for floating type.
14#[mel_function(
15 generic F (Float)
16)]
17pub fn neg_infinity() -> F {
18 let f = generics.get("F").unwrap();
19
20 f.float_neg_infinity()
21}
22
23/// Return the not-a-number value for floating type.
24#[mel_function(
25 generic F (Float)
26)]
27pub fn nan() -> F {
28 let f = generics.get("F").unwrap();
29
30 f.float_nan()
31}