Hi,
I have a fixed point math class, that completely should replace
"float" on PocketPC. However the 3D graphics created look a bit odd. I
think there's some bug somewhere. Is there any source code that
"tests" math classes like these, or do I have to write one myself?
Thank you,
--
-Gernot
int main(int argc, char** argv) {printf
("%silto%c%cf%c gl%ssic%ccom%c" , "ma", 58, 'g', 64, "ba", 46, 10);} 1 1688
Gernot Frisch wrote: Hi,
I have a fixed point math class, that completely should replace "float" on PocketPC. However the 3D graphics created look a bit odd. I think there's some bug somewhere. Is there any source code that "tests" math classes like these, or do I have to write one myself?
The problem wouldn't be the infamous "fixed point vector graphics
middle of the screen cross effect thingy", would it?
If so your rounding is not suitable for vector graphics.
And no, sorry, I don't know of any out-of-the-box tests.
But maybe you could define a "hybrid" version that does the
computations with double and your fixed-point-code in
parallel, and have every function check (e.g. ASSERT()) against
a maximum deviation. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Roger Leigh |
last post by:
Hello,
I'm writing a fixed-precision floating point class, based on the ideas
in the example fixed_pt class in the "Practical C++ Programming" book
by Steve Oualline (O' Reilly). This uses a long int to store the
value, and the precision (number of decimal points) is variable (it's
a templated class):
template <size_t _decimal_places = 4>
class FixedFloat {
|
by: Michel |
last post by:
Hi there,
I need to make a poisson distribution function that uses:
double Math.Exp(double d)
The d argument is a negative number in my case. When d becomes bigger and
bigger, the result loses precision and is finally 0 (when d reaches 650)
because it is too small to fit in a double. In my case, d can become -10000,
so I need to have a greater precision number and Exp function.
|
by: pout |
last post by:
What are the purposes of fixed-point? When should it be used?
I read:
#define Int2Fixed(x) (((long)(short)x) << 16)
and the fixed-point in 16.16 format. Does the 16 in the MACRO refer to
integer or decimal part? For example, if in 8.24, should the macro be:
#define Int2Fixed(x) (((long)(short)x) << 24)?
|
by: HeroinNO.4 |
last post by:
Hello guys, sorry for my last version has a little "feature"(MS always
call his bug "feature"), and now I fixed it and show the source to you
all ! Just as the last version, copy the code below and save in a .htm
file, fox example : "1.htm", and run it in a browser support JavaScript
1.1 or later, the cool count down timer will show you ! If it doesn't
work, you may open http://www.fillweb.com in IE, and View->Source to
see the latest...
|
by: David Wade |
last post by:
Folks,
Looking at the sanity checks for math.h/math.c in "The Standard C library"
they use 4* DBL_EPSILON as the error range, which I think is equivalent to
three bits of error. Is this appropriate on old style IBM 370 libraries with
its nasty drifting prescion? If not what would be an appropriate value.
Dave.
P.S. Its just I am having problems with exp() and log() I expected these to
| |
by: astri |
last post by:
i`m doing my thesis comparing CORDIC with polynomial in counting arctan with fixed point. I`m using Q15 format now. I`m using this site CORDIC arctan as a referenced when making with floating point. The problem there`s a lot of error when i try to make it with fixed point.
this is my program
#include "Unit1.h"
#include "math.h"
#include "fixed_math.hpp"
#define MAXBITS 15
static float invGain1;
|
by: John |
last post by:
Hi there,
I need to create a rectangle between two points so that I can check what
is inside it using Contains(). The problem I am having is how to make the
rectangle be able to cope with the angle between the two points, see the
image in the link for what I mean.
http://homepage.ntlworld.com/andrew.baldock/bloodbowl/select.png
I am not interested in displaying anything in the rectangle, I just need
|
by: Alejandro |
last post by:
Hi:
I need to find the multiples of a decimal number in a floating point
list. For instance, if a have the list , I want the
multiples of 0.2: .
With integers this problem is easy, just test for (i%n == 0), where i
is the number I am testing, and n is the multiple. Given the finite
resolution of floating point numbers, this is more complicated for
float.
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |