The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here

"Little time displaying bug?"

cherokeecherokee Member Posts: 82 Maven
edited May 2019 in Help
Hi!

Today I read following log message:
Jul 11, 2009 2:49:46 PM: [NOTE] Process finished successfully after 2 min 60 s
It's a bit strange with 60s. Is this a bug or a feature I don't understand?

Best regards,
Michael
Tagged:

Answers

  • steffensteffen Member Posts: 347 Maven
    Hello

    ... and I thought I was picky  ;D ...

    After a short laugh I gave myself 5 minutes to check where this error comes from. The function doing the formatting com.rapidminer.Tools#format(long) seems to be okay, so I guess you have found on the rare occasions where the storage of numbers with a limited number of bits shows its ugly face. I wouldnt wonder if the milliseconds have represented a value 59,9999999999999999999999999999999.... (sorry, no bits left) seconds.

    kind regards,

    Steffen
  • cherokeecherokee Member Posts: 82 Maven
    Ok, now that I know that I'm picky  ;)

    Let's get started. Now as I know where to search for the formating function (com.rapidminer.Tools.TimeFormat#format(long) I've looked it up myself. Your solution is right but there is a bug. ;D

    Formatting 60000 would result in "60s". In line 108 your checking if your ms-value is bigger than the desired "unit multiplicator", but 60s is exactly one minute even if it's not bitter than one minute. You should check for bigger or equal.

    By the way: You are using Time Format only with the default constructor. This way you have secondsFormat = new DecimalFormat("0"). This uses half_even rounding as default (http://java.sun.com/javase/6/docs/api/java/text/DecimalFormat.html). So even 59500 ms would be rendered as "60s".

    *pickymodeoff*

    Best regards,
    Michael

  • fischerfischer Member Posts: 439 Maven
    Hi,

    you are right, this was a really silly bug :-) We spotted it recently and it has already been fixed.

    Cheers,
    Simon
Sign In or Register to comment.