This commit is contained in:
Quaternions 2024-10-17 11:32:40 -07:00
parent f8f659e8ce
commit bffc5bb8f1

View File

@ -69,6 +69,7 @@ pub fn set_globals(lua:&mlua::Lua,globals:&mlua::Table)->Result<(),mlua::Error>{
let delay=f.max(0.0)*60.0; let delay=f.max(0.0)*60.0;
match delay.classify(){ match delay.classify(){
std::num::FpCategory::Nan=>Err(mlua::Error::runtime("NaN"))?, std::num::FpCategory::Nan=>Err(mlua::Error::runtime("NaN"))?,
// cases where the number is too large to schedule
std::num::FpCategory::Infinite=>return Ok(()), std::num::FpCategory::Infinite=>return Ok(()),
std::num::FpCategory::Normal=>if (u64::MAX as f64)<delay{ std::num::FpCategory::Normal=>if (u64::MAX as f64)<delay{
return Ok(()); return Ok(());