NO

Author Topic: floating point  (Read 4834 times)

drgott

  • Guest
floating point
« on: October 10, 2010, 04:25:06 am »
can anyone point me in the right direction concerning floating point operations on my htc (arm) and winmo pro 6.1?  from what i've read and experienced, there is no fp support except through microsoft's runtime library, so it looks like it's pretty much out of pellesc's control.  but is there a switch i'm missing?  i've used both fp compiler switches (i've read about ms's so called /QMFPE switch, but that's supposed to be the default, at least with their compilers).  is it just the htc?  i searched for "floating point" on this forum, but there's nothing.  am i the only one experiencing problems with this?  simple operations (multiply, add, etc) just silently fail.  occasionally, they will cause the app to crash, but usually not.  i don't have an emulator (not that necessarily means anything.)  i've tried using local variables, globals, passing the args as doubles, floats and pointers to them to see if the results are any different.  i've spread GetLastError() calls all around without success.  the help page refers to an fma() function in math.h, which can be dummied up to do a simply multiply, but that doesn't link.  the only thing i can consistently reproduce is: if i refer to hardcoded values, eg 3.1416 * 41.6950, things usually work.  once i assign such  values to a variable, eg float pi = 3.1416 or double pi = 3.1416 or #define pi 3.1416, the operation will fail.  any thoughts?  thanks in advance.

- george ott

drgott

  • Guest
Re: floating point
« Reply #1 on: October 13, 2010, 04:39:54 pm »
with further reference to my original post, 2 additional comments:
1) i was able to take the part of the project that deals with the floating point calculations and build it on evc++ using the winmo sdk6 libs/headers.  it runs fine on the device.  so, returning to pellesc, i modified the project so that it execs the little evc++ utility when it needs to do the calculations, using the registry to pass some values back and forth.  seems responsive enough for my purposes, although i could change things further to use createprocess().  in any case, there does seem to be a difference in how the 2 environments handle floating point.  i don't know whether it's an arm4 vs arm4i, issue, but my understanding was the ms runtime library was supposed to handle floating point calculations.  but there may be an issue with the compiler, after all.  see #2 below.

2) although i could not find any references to floating point issues on the forum i did find this: http://forum.pellesc.de/index.php?topic=3000.msg11407#msg11407
kind of related, especially as regards the gps sample supplied by pelle.  so, i thought about using version 5 instead of version 6 (the one i'm currently using).  as i was about to download v5, i see there is now v6.5.  i'm wondering if anyone monitoring the forum knows whether the "double" issue mentioned in the above forum topic has been addressed in v6.5.  which leads me to my next question: is it ok to run 2 different versions of pellesc on my computer.  in other words, my guess is, if i install v5 or v6.5 to see if my floating point issue goes away, it's going to want to clobber the current version 6.  i realize it's not the end of the world if i have to reinstall things, but i was wondering what others have done.  thanks.

ml

  • Guest
Re: floating point
« Reply #2 on: December 09, 2010, 08:47:26 pm »
I think the problem i described in http://forum.pellesc.de/index.php?topic=3000.msg11407#msg11407 is fixed in verion 6.5.
See changlelog "Changes between version 6.00 and version 6.50:"
Quote
Fixed problem with clobbering of 8-byte values (double/long long/struct) loaded through a pointer (ARM).
But this problem is specific to double variables passed by value; float variables and floating point operations are not affected.

ml

drgott

  • Guest
Re: floating point
« Reply #3 on: December 25, 2010, 10:41:39 pm »
yeah, thanks.  i was a bit reluctant to move to 6.5 (since everything else was working fine under 6.0), but i switched, and all the floating point issues disappeared!  saddened to see support for arm fading away.

saliha

  • Guest
Re: floating point
« Reply #4 on: February 23, 2011, 01:50:13 pm »
The term floating point refers to the fact that the radix point  (decimal point, or, more commonly in computers, binary point) can "float" that is, it can be placed anywhere relative to the significant digits of the number. This position is indicated separately in the internal representation, and floating-point representation can thus be thought of as a computer realization of scientific notation. Over the years, several different floating-point representations have been used in computers; however, for the last ten years the most commonly encountered representation is that defined by the IEEE 754 Standard.