|
|
View previous topic :: View next topic |
Author |
Message |
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Wed Mar 20, 2024 6:24 am |
|
|
hmm..curious .HOW did you display the result ?
The printf() may have reformatted the actual result into 'readable' format ?
Maybe a compiler 'bug' that converts 'double' into 'float' ?
Maybe it's the first day of Spring ? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Wed Mar 20, 2024 9:08 am |
|
|
What he has is a compiler bug. It was documented here a few versions
ago. It is very interesting that using double made it work, but he is not
actually using double, what is happening is that this keyword just happens
to be fixing a bug with the compiler!.....
Get a replacement for the compiler. CCS will supply you a fixed version.
Won't fix your speed issue, but at least will get rid of the confusion.
The one that will genuinely give you the right value, is int32, and this will
be enormously faster. What is posted here will be very inefficient, since
each integer has to be converted to float, then added. Much faster to
do the additions, and then convert the answer to float for the division.
This is an example of how important understanding the implications of
type on speed is. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|