Fixed-point arithmetic
#1
Posted 04 May 2012 - 08:43 AM
#2
Posted 04 May 2012 - 11:29 AM
#3
Posted 04 May 2012 - 11:32 AM
#4
Posted 04 May 2012 - 11:35 AM
Hi aalmada,
You wrote a fully-managed floating-point arithmetic class? That is very cool.
Chris
Nope: it's *fixed* point...that's the oddity.
#5
Posted 04 May 2012 - 12:01 PM
Aah. I read that wrong. Makes sense.Nope: it's *fixed* point...that's the oddity.
Chris
#6
Posted 04 May 2012 - 01:06 PM
Your effort is valuable, but...why did you create a fixed point math when there is a full-featured set of primitives working very well?
BTW, I'm not sure at all, but the "Single" (float) type should be treated directly from the CPU. Instead, the "Double" is much heavier to treat, and should be avoided in the MF. That's for either performance and memory occupation.
Thanks for sharing, anyway.
Cheers
Having the "full-feature set" doesn't always mean that that's the best performing solution. Just ask the game development people. They usually go out of their way just to save one clock cycle. They are the kind of people that use fixed-point arithmetic: http://netwinder.osu...nw/fix1FAQ.html
I found the following at the TinyCLR forum: "floating point is supported in NETMF, not matter if the processor supports it or not. ARM7 do not have floating point"
I know I should have benchmarked the performance of native types first but I was curious how fixed point works anyway. I was surprised to find that the performance on a Netduino for the multiplication of Int16, Int32, Single or Double, is exactly the same. Unlike you state above, or I'm doing something wrong then...
I found in my recent research that TinyCLR has a native compilation of MathEx for better performance: http://www.tinyclr.c...28/#/1/msg11672
Anyway, it was a great ride and I'm back to my Single-based arithmetic...
aalmada
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users