Restrict the Domain

Write a function restrict_domain that receives a function operating on
floats f, a lower bound lb and an upper bound ub. Then, restrict_domain
returns a new function that operates exactly as f within the closed
interval [lb, ub]. Outside that interval, the function produced returns
$float("-inf")$.

Problem information

Author: Jordi Delgado and José Luis Balcázar

Generation: 2026-01-25T14:36:42.064Z

© Jutge.org, 2006–2026.
https://jutge.org
