I am compiling a simple shopping program that is taking a double quantity multiplying it by double price to return a subtotal, but it is returning it as a INT not a Double, I receive the warning in the compile box, my IOS fixed is set, setprecision is on and showpoint is on...any other ideas?? Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hmmm, I must be missing something here. All the stuff you mentioned only controls how a number is displayed, not the nature of the number itself.
I am having to guess here, but are you doing some calculation that might be casting your float as an integer.
Of course, I may be mis-interpreting one other thing. What do you mean by "returning"? Displaying? I have a weird filter that looks at the term returning in terms of a function return.
Wayne
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am compiling a simple shopping program that is taking a double quantity multiplying it by double price to return a subtotal, but it is returning it as a INT not a Double, I receive the warning in the compile box, my IOS fixed is set, setprecision is on and showpoint is on...any other ideas?? Thanks
Hmmm, I must be missing something here. All the stuff you mentioned only controls how a number is displayed, not the nature of the number itself.
I am having to guess here, but are you doing some calculation that might be casting your float as an integer.
Of course, I may be mis-interpreting one other thing. What do you mean by "returning"? Displaying? I have a weird filter that looks at the term returning in terms of a function return.
Wayne
Does your function header contain...
int function (double one, double two)
{
return one * two;
}
instead of...
double function (double one, double two)
{
return one * two;
}
Curtis
Thanks Curtis...thought that might been the issue..but after a night of Unix,,,,but it worked!! WooHoo
no problem
Curtis