prayer-times icon indicating copy to clipboard operation
prayer-times copied to clipboard

NightPortion method returns 0 for angle based rule calculations

Open nadsmoo opened this issue 6 years ago • 0 comments

Asalamu alaikum wa rahmatullahi wa barakatu akhi,

The line : if (this.HighLatitudeAdjustmentMethod == HighLatitudeAdjustmentMethods.AngleBased) return 1 / 60 * angle;

Should be : if (this.HighLatitudeAdjustmentMethod == HighLatitudeAdjustmentMethods.AngleBased) return 1d / 60d * angle;

Without this, the fraction returns 0 ( as it does integer division and returns a whole number), by setting the values to doubles a fraction is returned and angle based calculations work correctly.

Jazakallahu khairan for your good work.

Nad

nadsmoo avatar May 12 '18 23:05 nadsmoo