actually problem solved; i was using longs instead of long doubles