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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Ferdinando M. Ametrano-3
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
Reply | Threaded
Open this post in threaded view
|

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

bill duo
Hello, Nando,

We have updated it, and now it is correct.

Regards,
Bill

------------------------------ Original Message ------------------------------
Subject: Re: [Quantlib-dev] [QuantLib-svn] SF.net SVN: quantlib:[15348] branches/oh_functions
From:    "Ferdinando Ametrano" <[hidden email]>
Date:    Thu, August 7, 2008 15:07
To:      [hidden email]
Cc:      [hidden email]
------------------------------------------------------------------------------

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




-------------------------------------------------------------------------
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