Results 1 to 4 of 4

Thread: Mathematical Functions

  1. #1
    Join Date
    Nov 2007
    Posts
    7
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Mathematical Functions

    can we use mathematical functions such as sin(), cos(), sqrt(), pow(), etc in Qt? If it is possible What is the header for that functions?

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Mathematical Functions

    J-P Nurmi

  3. #3
    Join Date
    Nov 2007
    Posts
    7
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Mathematical Functions

    hi JPN

    Thanks for uour reply.
    Few of unix flavors does not support math.h, any thoughts?

    Those functions are available ECMAScript Reference in Qt but am failed to insert the header QtScript, am using Qt 4.3.2 Open Source Edition.

    http://doc.trolltech.com/4.3/ecmascript.html

    Thank You.

  4. #4
    Join Date
    Nov 2006
    Location
    Shrewsbury, UK
    Posts
    97
    Thanks
    3
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Mathematical Functions

    Try using "#include <cmath>" and either explicitly using "std::cos", "std::sin" etc, or putting in a "using namespace std;" line. Using the explicit form works for me on Win32 and Linux platforms.

    Pete

Similar Threads

  1. File system utility with more functions than QDir
    By izico in forum Qt Programming
    Replies: 3
    Last Post: 22nd December 2007, 15:44
  2. Dynamically add functions to qt program
    By sincnarf in forum Qt Programming
    Replies: 31
    Last Post: 22nd September 2007, 04:55
  3. Replies: 12
    Last Post: 14th August 2007, 18:54
  4. Replies: 2
    Last Post: 16th March 2007, 10:04
  5. Qt/Embedded Installation error during make
    By mahe2310 in forum Installation and Deployment
    Replies: 5
    Last Post: 7th September 2006, 05:05

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.