Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace gml
- {
- double min(StackParams params)
- {
- double out = std::numeric_limits<double>::max();
- for(unsigned i=0; i<params.argc; ++i)
- {
- auto t = DataType(params.ds->pop_value<uint8_t>());
- assert(t == DataType::f64);
- double x = params.ds->pop_value<double>();
- if(x < out) {
- out = x;
- }
- }
- return out;
- }
- double max(StackParams params)
- {
- double out = std::numeric_limits<double>::min();
- for(unsigned i=0; i<params.argc; ++i)
- {
- auto t = DataType(params.ds->pop_value<uint8_t>());
- assert(t == DataType::f64);
- double x = params.ds->pop_value<double>();
- if(x > out) {
- out = x;
- }
- }
- return out;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment