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

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

[Octave-bug-tracker] [bug #45639] Formatting float as integer is not wor


From: anonymous
Subject: [Octave-bug-tracker] [bug #45639] Formatting float as integer is not working any more
Date: Mon, 27 Jul 2015 17:11:41 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko

URL:
  <http://savannah.gnu.org/bugs/?45639>

                 Summary: Formatting float as integer is not working any more
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Mo 27 Jul 2015 17:11:40 UTC
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Reiner Suikat
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.0.0
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

Up to the latest 3.6.x version the statement
printf("%d...", x)
would format x as an integer, regardless if it in fact was a float. (So 3.4
would print as 3). This is the same behaviour as I would expect to see in any
other programming language as well.

Since version 4.0 the same statement will not round the number, it will print
a floating point value when x is not an integer. (So it now prints 3.4 as 3.4)
This causes my code to fail and is absolutely inconsistent with any
programming language I know.

Also I have been unable to find a format conversion that would in fact produce
the desired result.




    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Nachricht gesendet von/durch Savannah
  http://savannah.gnu.org/




reply via email to

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