octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #36278] Sprintf %d bugs


From: Rik
Subject: [Octave-bug-tracker] [bug #36278] Sprintf %d bugs
Date: Thu, 14 Mar 2013 16:43:45 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:19.0) Gecko/20100101 Firefox/19.0

Follow-up Comment #5, bug #36278 (project octave):

>From Michael's testing,


>> sprintf ('%d', 1.3e15)

ans =

1.300000e+15

>> sprintf ('%ld', 1.3e15)

ans =

1300000000000000

>> version

ans =

7.9.0.529 (R2009b)

>>


Matlab appears to be fiddling with the format conversion string when the
result would overflow.  In this case, '%d' is replaced by '%e'.

Seems like there would be quite a penalty to check all numbers against the
format string rather than just handing everything over to the underlying C
library routine.

It is definitely a compatibility issue, but maybe we don't want to fix it.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?36278>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]