Results 1 to 4 of 4

Thread: Max and Min Values for qint64

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2008
    Posts
    24
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Max and Min Values for qint64

    Are there constants that define the maximum and minimum values for a qint64?

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Max and Min Values for qint64

    Your system might define LLONG_MIN and LLONG_MAX in climits (or limits.h). You could define them yourself:
    Qt Code:
    1. const qint64 llong_max = Q_INT64_C(9223372036854775807);
    2. const qint64 llong_min = Q_INT64_C(-(llong_max) - 1);
    3. // const qint64 llong_min = Q_INT64_C(-9223372036854775808); Generates a warning in my compiler
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    506
    Thanks
    11
    Thanked 76 Times in 74 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Max and Min Values for qint64

    Hi, since qint64 is just a typedef you should be able to use
    Qt Code:
    1. std::numeric_limits < qint64 >::max() and ...min()
    To copy to clipboard, switch view to plain text mode 
    to get the maximum/minimum.

    Ginsengelf

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Max and Min Values for qint64

    Indeed you can. I should have coffee before I visit these forums in the morning

Similar Threads

  1. (noob question) write qint64 into qsharedmemory
    By daemonna in forum Qt Programming
    Replies: 1
    Last Post: 28th June 2010, 11:28
  2. Getting the values from xml file
    By Kokos in forum Newbie
    Replies: 1
    Last Post: 6th April 2010, 10:32
  3. QComboBox values?
    By dbrmik in forum Newbie
    Replies: 8
    Last Post: 9th January 2009, 08:32
  4. QSlider and qint64 values
    By kemp in forum Qt Programming
    Replies: 1
    Last Post: 14th October 2007, 20:19
  5. qint64 to QString
    By Morea in forum Newbie
    Replies: 1
    Last Post: 24th March 2006, 08:21

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.