Created
May 17, 2020 17:00
-
-
Save kittylyst/034910dd55fd392dcd68274c246558f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn double_mapper_factory(tfm: fn(f64) -> f64) -> fn(&InterpLocalVars) -> Option<JvmValue> { | |
|args: &InterpLocalVars| -> Option<JvmValue> { | |
let d = match args.load(0) { | |
JvmValue::Double { val: v } => v, | |
x => panic!("Non-double value {} of type {} encountered in Math", x, x.name()) | |
}; | |
Some(JvmValue::Double {val: tfm(d)}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment