Results 1 to 6 of 6

Thread: Square function

  1. #1
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Square function

    Hi,

    Is there any Qt function to get the square of an integer? I'm not able to find it.

    Thanks,
    Òscar Llarch i Galán

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Square function

    Quote Originally Posted by ^NyAw^ View Post
    Is there any Qt function to get the square of an integer? I'm not able to find it.
    No there isn't one, because you can write one yourself in a few seconds.

  3. #3
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Square function

    Hi,

    Ok, thanks. I will use the functions that are avaiable in the standard mathematic functions in "math.h".

    Thanks,
    Òscar Llarch i Galán

  4. #4
    Join Date
    Aug 2006
    Location
    Bangalore,India
    Posts
    419
    Thanks
    37
    Thanked 53 Times in 40 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Square function

    Quote Originally Posted by ^NyAw^ View Post
    Hi,

    Ok, thanks. I will use the functions that are avaiable in the standard mathematic functions in "math.h".

    Thanks,
    Use <cmath> since all methods are enclosed in std namespace. "math.h" is C header file not c++.
    The biggest difference between time and space is that you can't reuse time.
    -- Merrick Furst

  5. #5
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Square function

    Hi,

    "math.h" is C header file not c++
    I know. "math.h" is the header file. I don't said anytime that it is c++. What do you understand with that is not c++ ?

    I only want the function that returns me the square of a number and it doesn't matter if ther is a class that resolves it or is a function. So I could use sqrt function including math.h or using the std namespace that will call the same function.

    Thanks for the reply
    Òscar Llarch i Galán

  6. #6
    Join Date
    Aug 2006
    Location
    Bangalore,India
    Posts
    419
    Thanks
    37
    Thanked 53 Times in 40 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Square function

    Quote Originally Posted by ^NyAw^ View Post
    Hi,



    I know. "math.h" is the header file. I don't said anytime that it is c++. What do you understand with that is not c++ ?

    I only want the function that returns me the square of a number and it doesn't matter if ther is a class that resolves it or is a function. So I could use sqrt function including math.h or using the std namespace that will call the same function.

    Thanks for the reply
    Yep, anything will do as long it solves problem. I guess I am too much into c++
    Sorry for the "offtopic" answer.
    The biggest difference between time and space is that you can't reuse time.
    -- Merrick Furst

Similar Threads

  1. Link Errors
    By magikalpnoi in forum Qt Programming
    Replies: 5
    Last Post: 25th September 2006, 22:04
  2. use qpsql
    By raphaelf in forum Installation and Deployment
    Replies: 34
    Last Post: 22nd August 2006, 12:52
  3. Qt 4.1.4 plugin QPSQL
    By jcr in forum Installation and Deployment
    Replies: 4
    Last Post: 22nd June 2006, 22:55
  4. I got two problems when I used static compiled library of QT4
    By qintm in forum Installation and Deployment
    Replies: 8
    Last Post: 20th April 2006, 08:52
  5. use libs under qt4
    By raphaelf in forum Qt Programming
    Replies: 6
    Last Post: 27th February 2006, 17:59

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.