Re: Patch for DateTime::Format::W3CDTF to respekt second fragment part

2007-11-08 Thread Zefram
Jonathan Leffler wrote: Or, what happens if there are 10 digits after the decimal point. That's what the substr() is for. Yeah, mostly academic, except I'm working towards a time type (not for Perl per se) that extends down to picoseconds (and up to 10^12 years, too). At least 105 bits, then.

Re: Patch for DateTime::Format::W3CDTF to respekt second fragment part

2007-11-08 Thread Jonathan Leffler
Zefram [EMAIL PROTECTED] wrote: Re: Patch for DateTime::Format::W3CDTF to respekt second fragment part Julian Haupt wrote: +if ($date =~ s/\.(\d+)$// ) +{ + my $fraction = $1; + $p{'nanosecond'} = (1 / $fraction) * 10**9; +} That inversion can't be right. Surely you

Re: Patch for DateTime::Format::W3CDTF to respekt second fragment part

2007-11-07 Thread Zefram
Julian Haupt wrote: +if ($date =~ s/\.(\d+)$// ) +{ + my $fraction = $1; + $p{'nanosecond'} = (1 / $fraction) * 10**9; +} That inversion can't be right. Surely you mathematically want $p{'nanosecond'} = 0.$fraction * 10**9; but actually the nanoseconds member is