# New Ticket Created by  Vadim Zeitlin 
# Please include the string:  [perl #113996]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=113996 >


 Hello,

 With the latest (as of 2012-07-05) version of Rakudo from nom branch I get

% ./perl6 -e 'printf "%mf\n",1+2i'
'm' is not valid in sprintf format sequence '%m'
  in sub sprintf at src/gen/CORE.setting:2067
  in sub printf at src/gen/CORE.setting:2072
  in block <anon> at -e:1

Although, according to the spec, it's supposed to work.

 I thought this would be trivial to fix and started looking into doing this
myself but unfortunately I got completely lost. AFAICS sprintf() is
implemented in src/core/Cool.pm but it simply forwards to Parrot. And I
have no idea what is the right thing to do here: modify Parrot to support
"%m" (but does it even have complex numbers?)? Massage the format string
and the arguments to transform "%m" into "%f+i%f" or something like this
and the complex number into its real and imaginary parts? This should work
but looks clumsy...

 So I'm afraid it's not as trivial as I thought or at least not
sufficiently trivial for me to fix it myself. Hopefully somebody else can
do it.

 Thanks,
VZ

Attachment: pgpmfnbSa8CzH.pgp
Description: PGP signature

Reply via email to