Ticket #857 (closed bug: fixed)

Opened 7 years ago

Last modified 6 years ago

Parrot_floatval_time() and Parrot_intval_time() do not match up on Win32

Reported by: jkeenan Owned by: Paul C. Anagnostopoulos
Priority: normal Milestone:
Component: core Version: 1.3.0
Severity: medium Keywords: time
Cc: infinoid whiteknight Language:
Patch status: Platform: win32


This ticket was created by Infinoid as  http://rt.perl.org/rt3/Ticket/Display.html?id=53538 RT #53538] in April 2008. It was never resolved there, but since a companion ticket has been resolved, I am moving it to the Trac system in the hope that higher visibility will lead to its resolution.

Original description:
When running the following PIR:

.sub main
I0 = time
print I0
print "\n"
N0 = time
print N0
print "\n"
I0 = N0
print I0
print "\n"

On linux, I get:


This is what we expected.

On Mingw32, I get:


On MSVC, wknight8111 got:


These numbers are completely wrong. This causes problems elsewhere; for instance, the code in Parrot_cx_schedule_sleep() expects the two timestamp formats to match up, so it can calculate the correct time to wake up again.

Change History

Changed 6 years ago by NotFound

I've tried this modernized version of the snippet:

.sub main
$I0 = time
say $I0
$N0 = time
say $N0
$I0 = $N0
say $I0

Using parrot built with Strawberry perl in Windows XP Home and the result looks good:


Changed 6 years ago by Paul C. Anagnostopoulos

  • owner set to Paul C. Anagnostopoulos
  • status changed from new to assigned

Changed 6 years ago by Paul C. Anagnostopoulos

  • status changed from assigned to closed
  • resolution set to fixed

I'm confused. This appears to have been a float-to-integer conversion problem, having nothing to do with the system time. It works fine for me on a 32-bit Windows XP platform running Mingw32. I'm going to close this ticket.

Note: See TracTickets for help on using tickets.