Could also give you the feeling of being uncomfortable. Then when you are struggling working through a problem you get so frustrated. And think "If only it weren't so damn hot in here." Then all you can think about is the heat, and you are so lost it cannot be returned. So then you give up for the day, and really haven't accomplished anything.
Exactly, your mileage may vary, but my mindset has to be completely free from distractions to be productive.
The library on my uni when I was in Math undergrad did not have AC at the beggining but was the only place where I could do any work, it was extremely difficult and I am sure impacted my progress.