PDA

View Full Version : Number PI



digog
21st April 2011, 23:54
Sorry for this newby question, but is the number PI defined in Qt??
If it isnt, in which library can I find a declaration for the number PI?

SixDegrees
22nd April 2011, 00:31
<math>, <math.h>

digog
22nd April 2011, 02:10
<math>, <math.h>

Ok thanks.

I found it also in qmath.h.

What the difference between the math.h and qmath.h??
I mean, if I need to call a square root function whats the difference between sqrt() and qSqrt()?
And where can I find a square function?

ChrisW67
22nd April 2011, 03:38
Asking the same thing in two places is bad form.

See http://www.qtcentre.org/threads/40901-quot-math.h-quot-VS-quot-qmath.h-quot

htroyo
23rd April 2011, 05:33
maybe the difference is (i haven't use qmath.h) qmath.h was developed using OOP or Qt "primitive" types (for example if a function of math uses char* the equivalent in qmath.h uses QString wich is better than char*...), but as i told you before, i haven't used qmath.h and almost math.h

DanH
25th April 2011, 02:50
qmath uses Qt data types and is sensitive to certain Qt settings.