1

Hi guys, I am a novice in C programming, and would like to ask you for help as I've started studying a computer science at university just few weeks ago. All I need to do is write a math function "pow(double x, double y)" without using any of functions in math.h library. There's no problem to do it for me if "y" is an integer number, but once it gets and float value, I am lost. For example how would you solve this one case: 2^3.56
Thanks in advance

Regards
Creck

2
Contributors
3
Replies
5
Views
4 Years
Discussion Span
Last Post by creck
0

Wait, you're a novice and you've been given an assignment to write a floating point pow() without any math.h functions in the first few weeks of a CS course? Something seems off there, because this isn't exactly a trivial exercise.

For example, take a look at the implementations here. They're designed to be short and simple, yet pow() still depends on a relatively large amount of scaffolding.

0

Yeah, exactly as you wrote; I am currently attending first semester at university...All I have ever been programming were some trivial functions at high school in PASCAL and now after few weeks being here I got to create a project with few math functions without using math.h library. One of that function is pow with floating point :/ Thanks for that link deceptikon, I am gonna take a look on it.

0

Well, I have already took a look on that, but have no idea where to start at all :/ Do u have any advices how could I start ? Any principle how does it work?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.