Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Need help with C++


  • Please log in to reply
2 replies to this topic

#1 n0l1f3r

n0l1f3r

  • Members
  • 3 posts
  • OFFLINE
  •  
  • Location:Estonia
  • Local time:09:29 AM

Posted 26 October 2008 - 04:25 AM

Oke i want to make an program which uses arctanh (Log((1 / x + 1) / (1 / x - 1)) / 2), and i only need to ask "x", and btw area is given: 0,2<x<1 any ideas how to make it?

i know i need to use math.h but i dont know how tu use formula in code...


thanks

BC AdBot (Login to Remove)

 


m

#2 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,301 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:12:29 AM

Posted 26 October 2008 - 11:10 AM

Docs for all the <cmath> functions are here:
http://www.cplusplus.com/reference/clibrary/cmath/

As far as I know, C does not have built in support for arctanh. You're going to have figure out how to compute that one on your own ;)

Billy3
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image

#3 Romeo29

Romeo29

    Learning To Bleep


  • BC Advisor
  • 3,194 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:127.0.0.1
  • Local time:02:29 AM

Posted 26 October 2008 - 12:55 PM

In C you can find hyperbolic arctangent using the following formula:

arctanh(x) = (1.0/2.0) * log((1+x) / (1-x))

Edited by Romeo29, 26 October 2008 - 12:58 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users