473,396 Members | 2,034 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Formula into C code...

I need to translate this formula into C code, but I know very little programming. Can anyone help?

http://mathworld.wolfram.com/images/equations/MeanDeviation/equation1.gif
Sep 10 '07 #1
5 1719
r035198x
13,262 8TB
I need to translate this formula into C code, but I know very little programming. Can anyone help?

http://mathworld.wolfram.com/images/equations/MeanDeviation/equation1.gif
Read a C tutorial and pay special attention to the math functions available.
Sep 10 '07 #2
arnaudk
424 256MB
The moderators on this forum are particularly uncompromising when it comes to answering such questions directly even though it will probably take you a long time to write that code from zero knowledge but would take anyone with a little experience 30secs. It's a great idea to learn C or C++ but if it's auxiliary to your profession, then this might not be what you came here to be told.

Anyway, I suggest you start by writing a "hello world" program. You can copy-paste the code for that from anywhere. Once you get that going, perhaps I'm allowed to tell you that the main ingredients you'll need will be an array to store your x_i values which can be an array in the C sense "int a = {1, 1, 2, 3, 5, 8};" or, even better, a vector. Then a you'll need a for() loop and the abs() absolute value function.
Sep 10 '07 #3
JosAH
11,448 Expert 8TB
The moderators on this forum are particularly uncompromising when it comes to answering such questions directly even though it will probably take you a long time to write that code from zero knowledge but would take anyone with a little experience 30secs. It's a great idea to learn C or C++ but if it's auxiliary to your profession, then this might not be what you came here to be told.
Schools, colleges and universities are tough cookies when they discover copied
and pasted spoonfed solutions; they not only consider it cheating on behalf of the
student but they also go after the source of the spoonfed solution. And ever so
right they are. TSDN doesn't want to be a source of spoonfeeding nor cheating.

Even more important: suppose you're a professional software developer and also
suppose someone got away with the cheating, graduated and becomes your
co-worker. You'd have a double task/job then: doing your own thing as well as
cleaning up the mess created by your cheating co-worker.

kind regards,

Jos
Sep 10 '07 #4
arnaudk
424 256MB
I'm not a professional programmer but my experience gives me a different view about how to learn programming. Anyway, I won't mention it again. I think TSDN is a great site and I will abide by its rules.

To at least make my message relevant to this thread, Daikide you should will always get a better response to your question if you demonstrate some attempt to solve it yourself. Post some code you're having difficulty with. If you don't know C or C++ at all and want to learn it, then you can ask for advice about that specifically.
Sep 10 '07 #5
JosAH
11,448 Expert 8TB
The OPs question has (almost) nothing to do with C or C++; we can only guess
if the question has something to do with theoretical function theory, possibly with
a finite domain D and a finite co-domain C, i.e.f(D) --> C. What are we supposed
to answer? If f() is a surjection, injection of bijection? The cardinality of [D], |C|
can tell a lot before digging into gory details.

Just marking the particular c_i for a d_i can tell the rest.

kind regards,

Jos
Sep 10 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: RJN | last post by:
Hi I have a main report and a sub report. I have a formula field on the main report and one on the sub report. I want the formula in the subreport to be evaluated after the formula in the main...
0
by: RJN | last post by:
Hi Sorry for posting this message again. I have a main report and a sub report. I have a formula field on the main report and one on the sub report. I want the formula in the subreport to be...
0
by: rjn | last post by:
Hi I have a main report in which I have inserted a sub report. I have a formula field on the main report and one on the sub report. I want the formula in the subreport to be evaluated after the...
4
by: Wade | last post by:
Hi guys, I am building a string in code that is a mathematical formula, based on a lot of criteria specified by the user. Once the formula is complete, I want to evaluate it to get a result. ...
2
by: nickwright | last post by:
Me Again, I am trying to write a formula using VB Macro's. I currently have the following code as I believed this was correct, but I was wrong. Can anyone help with this If Sheets("Silo...
1
by: barnzee | last post by:
Hi all, newbie here, but having a go I am trying to build a stock watchlist in excel 2007 with a dynamic link to a DDE server (paid for from a broker).There is no add-in or plug-in, I just CTL ALT...
1
by: JHaworth | last post by:
Hi, Please could someone point me in the right direction with a formula I am trying to create which will enable me to calculate a Net IRR for a series of data? My Problem: •My formula in...
1
by: Monusonu | last post by:
Hi Expert, I am trying to get the value from excel formula cell using POI. My code works fine for less complex formula cells, but fails or returns error code for complex formula cells. Following...
30
by: Barry L. Bond | last post by:
Greetings! I just got a new Peet Brothers Ultimeter 2100 Weather Station. This new one has a way to display the heat index, if you press the "dew point" key twice. Being aware of all the...
2
by: Anni V | last post by:
Hi Can some one please help me with the formula to find the EMI from the textbox values txtemiconvamount ddltenure txtemicalcroi to display the EMI amount in the textbox txtemiamount The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.