dolphinsmalltalk / Dolphin

Dolphin Smalltalk Core Image
MIT License
301 stars 58 forks source link

Dolphin 7.1.24: Wrong seconds calculation in Duration class>>hours:minutes: #1183

Closed bernhardkohlhaas closed 1 year ago

bernhardkohlhaas commented 1 year ago

Describe the bug The result of the evaluation of Duration hours: 1 minutes: 0 is a duration of 2.5 days, instead of 60 minutes.

The bug is in method Duration class>hours:minutes: Instead of ^self seconds: (hoursNumber * 3600) + minutesNumber * 60,

it should be ^self seconds: (hoursNumber * 3600) + (minutesNumber * 60) that is with parentheses around minutesNumber * 60 (or alternatively something similar to the code in Duration class>>hours:minutes:seconds:)

To Reproduce Evaluate and display the result of Duration hours: 1 minutes: 0.

Please complete the following information):