python (65.2k questions)
javascript (44.3k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (13k questions)
C: Representing a fraction without floating points
I'm writing some code for an embedded system (MSP430) without hardware floating point support. Unfortunately, I will need to work with fractions in my code as I'm doing ranging, and a short-range sens...
HFOrangefish
Votes: 0
Answers: 1
ISO/IEC TR 18037 (fixed-point arithmetic): no signed zero?
In ISO/IEC TR 18037:2006(E) I don't see if there is a signed zero.
Consider this code:
int main(void)
{
_Sat short _Fract x, y;
x = 0.0078125HR; // SFRACT_EPSILON
y = x * x; // 0...
pmor
Votes: 0
Answers: 0
GCC: which targets support fixed-point types?
$ echo "_Fract x;" | gcc -xc -
<stdin>:1:1: error: fixed-point types not supported for this target
6.16 Fixed-Point Types (emphasis added):
As an extension, GNU C supports fixed-poin...
pmor
Votes: 0
Answers: 1
How do you convert the remainder of a division operation to a fixed point in C?
I understand the concept of fixed point pretty well at this point, but I'm having trouble making a logical jump.
I'm working with M68000 CPUs using gcc with no standard libraries of any sort. Using DI...

Ryou
Votes: 0
Answers: 1