Search found 10 matches

by nano72
Thu Mar 22, 2007 4:58 pm
Forum: C++
Topic: Need help in creating an object in c++
Replies: 1
Views: 2998

Need help in creating an object in c++

Does anyone know how i could create the following and pass it in to a method to do some analysis [ need to write it in c++ ] where by it initailises 4 differnt structures Any ideas how i could go about this ? at start up time the init object is initilised by passing in the appropriate values to each...
by nano72
Thu Sep 21, 2006 2:25 pm
Forum: Algorithms
Topic: Unixtime convertion to epoch time
Replies: 1
Views: 1311

Unixtime convertion to epoch time

Hi ,

Does anyone know how to convert unixtime back to epoch time ie YYYYMMDDHHMMSS
??????????????????????????
by nano72
Wed Sep 20, 2006 5:05 pm
Forum: Algorithms
Topic: Expression evaluator HELP
Replies: 2
Views: 1550

Expression evaluator HELP

hi , I am using the following code to do the evaluation a*b/2 (a+b)/2 but having difficult in getting my desired results .. Any ideas all help is much appreciated .. #include<cstdio> #include<iostream> #include<cstdlib> #include<cmath> #include<vector> #include<cstring> #include<cctype> #include<que...
by nano72
Wed Sep 20, 2006 4:52 pm
Forum: Algorithms
Topic: Expression Evaluator and Parsing
Replies: 2
Views: 2066

Hi ,

Does this code work now ?

Please advise
by nano72
Wed Sep 20, 2006 2:38 pm
Forum: Algorithms
Topic: Expression evaluator HELP
Replies: 2
Views: 1550

Expression evaluator HELP

Hi Guys ,

I am looking for a function that will evaluate the following expressions (eg..
13214.00
(a * b)/c
a+b

Has anyone code out there that will do any expression like the above ?

I have looked at some on the web but they seem too complex and not working ..

Please help.
Thanks
by nano72
Fri Sep 15, 2006 10:20 am
Forum: C++
Topic: Passing enum value thru a function call using C++
Replies: 2
Views: 2250

Ooops I meant to put opt infront of the operators ( it was a typo made in giving u the sample code)

should be
enum operatorType
{
opt_add,opt_sub,opt_mult,opt_not
};
by nano72
Thu Sep 14, 2006 7:12 pm
Forum: C++
Topic: Passing enum value thru a function call using C++
Replies: 2
Views: 2250

Passing enum value thru a function call using C++

Hi , I am having some difficult in passing inthe header file enum operatorType { add,sub,mult,not }; operatorType p_operatorType; Class{ } in the .cc file calling fn (A, p_operatorType,B); have it defined like so double fn(double A, enum operatorType *op, double B ) Any ideas why the C++ compiler do...
by nano72
Wed Sep 06, 2006 11:13 am
Forum: Volume 108 (10800-10899)
Topic: 10804 - Gopher Strategy
Replies: 39
Views: 23606

Hi Abednego,
Tried that substitude and it works for the .085 combination I now get .09 which is correct!
BUT for the .086 - i get .091 expect .09
for .081 - i get .86 expect .08
.08 get .085 where i expect to get .08 if rounding to nearest 0.01

Any ideas here ..

Thanks again !
by nano72
Tue Sep 05, 2006 7:09 pm
Forum: Volume 108 (10800-10899)
Topic: 10804 - Gopher Strategy
Replies: 39
Views: 23606

Thanks for that :) but checked it out and it doesn't do alot
My return value is 0.000000
where i would expect 0.09

the substituding is

double x = 0.085;
double m = pow( 10.0, 0.01);
x = (int)(0.085 * m + 0.5) / m;


Any ideas ..
by nano72
Tue Sep 05, 2006 5:35 pm
Forum: Volume 108 (10800-10899)
Topic: 10804 - Gopher Strategy
Replies: 39
Views: 23606

Double type rounding

Hi guys,

I am writing some code to do normal rounding passing it in the value say 0.085 rounding it to .01 places where i should get 0.09. (note this only one example I may want to round it .001, etc )
Has anyone out there a neat way I could so this in c++.

Thanks in advance ,
nano72

Go to advanced search