Replace min as macro