# Search:

Type: Posts; User: ninety3gd

Page 1 of 2 1

## Search: Search took 0.01 seconds.

by ninety3gd
Replies
4
Views
1,140

### Thank you all got what I needed...

Thank you all got what I needed...

by ninety3gd
Replies
4
Views
1,140

### Question about mixed data types- with division

cout << 17 / 3.0 << endl;
cout << 12.0 / 6 << endl;

5.66667
2

I realize about / and integer but why do I get an double result for the first...
3. ## Thread: Removal of gotos

by ninety3gd
Replies
14
Views
1,652

### Removal of gotos

Finally back at looking through code...I am trying to eliminate the gotos in the sudoku function below:

I have eliminated simple gotos before...

double sum = 0.0;

int x = 1;
...
4. ## Thread: modulo(%) operation with double

by ninety3gd
Replies
5
Views
27,066

### You can use % with C# or Java with real values...

You can use % with C# or Java with real values...

by ninety3gd
Replies
27
Views
15,549

### Well I have a sudoku solver- in C++ that finds...

Well I have a sudoku solver- in C++ that finds one, many, or no solutions...bad thing is the input I would have to type in by hand...unless I read it in a text file....
6. ## Thread: floor() and int()

by ninety3gd
Replies
9
Views
15,950

### CH is correct- trunc is available in C99...

CH is correct- trunc is available in C99 standard:

trunc- Truncate to nearest integral value:

double trunc(double x);

returns x rounded to the integer nearest to it but no larger in magnitude
7. ## Thread: floor() and int()

by ninety3gd
Replies
9
Views
15,950

### I always thought that if the values are integer...

I always thought that if the values are integer and positive the would both return the same value...but that is the only time that is the case...

(int) floor (1.1) = 1
(int)1.1 = 1

If they...
8. ## Thread: do while loop keeps looping

by ninety3gd
Replies
23
Views
5,191

### Nope, just pointing out that fact...Allready...

Nope, just pointing out that fact...Allready finished school-good exercise though
9. ## Thread: do while loop keeps looping

by ninety3gd
Replies
23
Views
5,191

### Doesn't look like your finished...still need to...

Doesn't look like your finished...still need to print the final product result...which you do not seem to have...

by ninety3gd
Replies
9
Views
985

### A you trying numerical differentiation..if so. ...

A you trying numerical differentiation..if so.

I would test that with some tolerance level:

tolerance a very small number

enter desired tolerance

...
while (tolExceded && something)
11. ## Thread: Rewrite code in structure way

by ninety3gd
Replies
3
Views
1,587

### Go it to work- used the loop as sugguested...

Go it to work- used the loop as sugguested...
12. ## Thread: Rewrite code in structure way

by ninety3gd
Replies
3
Views
1,587

### Rewrite code in structure way

Trying to eliminate a goto: from Schaums C++ book

double sum = 0.0;

int x = 1;
repeat: sum += 1.0 / x++;

if (x <= N)
goto repeat;
13. ## Thread: Using the log properties- math

by ninety3gd
Replies
6
Views
20,065

### figured out my problem- thanks for all of the...

figured out my problem- thanks for all of the insight
14. ## Thread: Using the log properties- math

by ninety3gd
Replies
6
Views
20,065

### Using the log properties- math

Kind of an offshoot of my previous post but this has to do with logarithmic properties

Change of base:

logbX = logaX/logaB

and

logb(X/Y ) = logbX - logbY
15. ## Thread: C++ string problem

by ninety3gd
Replies
6
Views
1,472

### Got it bithub...I just what look right from the...

Got it bithub...I just what look right from the texts on the matter

Forgot to find the parameter problem..and the caveat about getline...
16. ## Thread: help with fgets

by ninety3gd
Replies
25
Views
2,499

### here is how I would use a string with a struct; ...

here is how I would use a string with a struct;

struct exam
{
string name;
};

int main()
{

by ninety3gd
Replies
6
Views
1,012

### Sorry got my C/C++ confused- as mention needed to...

Sorry got my C/C++ confused- as mention needed to fix

struct a
{
char name[50];
int i;
};

int main(void)

by ninety3gd
Replies
6
Views
1,012

### All thought I am brushing back up on C/C++ I...

All thought I am brushing back up on C/C++ I would try to solve the problem without using pointers- then make change to pointers

struct a
{
char name[50];
int i;
}

int main(void)
19. ## Thread: C++ string problem

by ninety3gd
Replies
6
Views
1,472

### I would try the following- change... string...

I would try the following- change...

string user_information ( string name1, string name2)
{

cin >> name1;
20. ## Thread: logarithmic loop calculations

by ninety3gd
Replies
3
Views
22,967

### Basically I trying to find an all purpose...

Basically I trying to find an all purpose formula- derived from the following..

A loop where the loop control body is multiplied or divided...

for (i = m; i < n; i *= x)
do something

If the...
21. ## Thread: logarithmic loop calculations

by ninety3gd
Replies
3
Views
22,967

### logarithmic loop calculations

Help with math calc

Calculating efficiency of loops from both

Gilberg and Hortsmann books...

Logarithmic Loops (multiplication and division):

by ninety3gd
Replies
9
Views
1,316

### Do you have a textbook or use other sources to...

Do you have a textbook or use other sources to help as well?
23. ## Thread: Help with output

by ninety3gd
Replies
4
Views
2,533

### //eliminate the coefficients of X(I) for (i =...

//eliminate the coefficients of X(I)
for (i = k + 1; i < n; i++)
{
mult = a[i][k] / a[k][k];
b[i] = b[i] - b[k] * mult; //compute constants
for (j = k; j < n; j++) //compute...
24. ## Thread: Help with output

by ninety3gd
Replies
4
Views
2,533

### Help with output

Have the following Gauss Elim code from text:

Not printing out correct code:

SOLUTION OF SIMULTANEOUS LINEAR EQUATIONS
USING GAUSSIAN ELIMINATION

This program uses...
25. ## Thread: Off by a penny problem

by ninety3gd
Replies
2
Views
1,772

### Off by a penny problem

Getting the off by a penny problem...

Enter an amount in double, for example 11.56: 12.35