Login  Register

Re: [QuantLib-svn] SF.net SVN: quantlib:[15348] branches/oh_functions

Posted by Ferdinando M. Ametrano-3 on Aug 07, 2008; 2:07pm
URL: http://quantlib.414.s1.nabble.com/Re-QuantLib-svn-SF-net-SVN-quantlib-15348-branches-oh-functions-tp11919.html

On Thu, Aug 7, 2008 at 8:51 AM,  <[hidden email]> wrote:

> Revision: 15348
>          http://quantlib.svn.sourceforge.net/quantlib/?rev=15348&view=rev
> [...]
> --- branches/oh_functions/ObjectHandler/oh/utilities.cpp        2008-08-07 06:49:16 UTC (rev 15347)
> +++ branches/oh_functions/ObjectHandler/oh/utilities.cpp        2008-08-07 06:51:19 UTC (rev 15348)
>[...]
> @@ -305,17 +318,20 @@
>             }
>         }
>         OH_REQUIRE(b, "month outside valid range");
> -        totalSecond -= days * SECS_PER_DAY;
> +        totalMSecond -= days * MILLISECS_PER_DAY;
>
>         days -=  pMonth[monthoffset - 1];
>
> -        hours = totalSecond / 3600;
> -        totalSecond -= hours * 3600;
> -        minutes =  totalSecond / 60;
> -        seconds = totalSecond - minutes * 60;
> +        hours = totalMSecond / (3600 * 1000);
> +        totalMSecond -= (hours * 3600 * 1000) ;
> +        minutes =  totalMSecond / (60 * 1000);
> +        totalMSecond -= minutes * 60 * 1000;
> +        seconds = totalMSecond / 60 * 1000;
> +        milliseconds = totalMSecond - seconds * 1000;

if I get it right it should be:

> +        seconds = totalMSecond / 1000;
> +        milliseconds = totalMSecond - seconds * 1000;

ciao -- Nando

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev