Restrict the Domain

Write a function restrict_domainrestrict\_domain that receives a function operating on floats ff, a lower bound lblb and an upper bound ubub. Then, restrict_domainrestrict\_domain returns a new function that operates exactly as ff within the closed interval [lb,ub][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