Toon posts:

wortel trekken in c

Pagina: 1
Acties:
  • 1.010 views sinds 30-01-2008

Verwijderd

Topicstarter
ik ben bezig met een programmatje te schrijven dat verschillende reken formules kan toe passen. dat bestaat al lang mss, maar ik wil het zelf schrijven natuurlijk :P

mijn enige vraag tot nu toe is hoe kan ik in c aangeven dat ik de wortel uit een getal wil hebben.

bijv.

wortel uit 4 is twee. maar ik wil de wortel trekken uit een variabele. (een float, int etc. )

wat moet ik doen? mss is het niet moeilijk, maar ik weet t ff niet.

alvast bedankt

  • NMe
  • Registratie: Februari 2004
  • Laatst online: 19-05 21:24

NMe

Quia Ego Sic Dico.

C:
1
sqrt(getal);

of
C:
1
pow(getal, 0.5);

Moet je wel math.h includen.

En in het vervolg mag je beter zoeken. :/

'E's fighting in there!' he stuttered, grabbing the captain's arm.
'All by himself?' said the captain.
'No, with everyone!' shouted Nobby, hopping from one foot to the other.


  • Creepy
  • Registratie: Juni 2001
  • Nu online

Creepy

Tactical Espionage Splatterer

Wat NMe84 zegt dus. In een beetje C boek is wel een stukje te vinden over de math.h ..

"I had a problem, I solved it with regular expressions. Now I have two problems". That's shows a lack of appreciation for regular expressions: "I know have _star_ problems" --Kevlin Henney


Dit topic is gesloten.