|
Hi Pinus..
Thanks for the quick response. ARROW_COSINE[0] = m_oFixed.valueOf("0.000"); In the above statement "m_oFixed" is an object of "Fixed" class used in our application. Am pasting the code below. Fixed Fixed::valueOf(char* sValue){ // Fixed* fx = new Fixed(sValue, STRLEN(sValue)); //REPORT_ALLOC(fx); Fixed retFX; retFX.m_lValue = strToX(sValue); //DELETE_OBJECT(fx); return retFX; } long strToX(char* sValue){ UInt32 result; int len = StrLen(sValue); int signBit = 0; char whole[20]; char fraction[20]; int i = 0; char val = sValue[i]; // Get the sign parity if(val == '-'){ signBit = 1; i++; } // Get Whole Number int wholeCount = 0; while(i < len){ if((val = sValue[i]) == '.'){ break; } if(val == '0' || val == '1' || val == '2' || val == '3' || val == '4' || val == '5' || val == '6' || val == '7' || val == '8' || val == '9'){ whole[wholeCount++] = val; } i++; } i++; whole[wholeCount] = '\0'; // Get Fractional Number int fractCount = 0; while(i < len){ val = sValue[i]; if(val == '0' || val == '1' || val == '2' || val == '3' || val == '4' || val == '5' || val == '6' || val == '7' || val == '8' || val == '9'){ fraction[fractCount++] = val; } if(fractCount == Fixed::FIXED_PRECISION){ break; } i++; } while(fractCount < Fixed::FIXED_PRECISION){ fraction[fractCount++] = '0'; //fractCount++; } fraction[fractCount] = '\0'; result = (StrAToI (whole) << Fixed::FIXED_SHIFT); result |= (StrAToI (fraction) & Fixed::FRACT_AND); result |= ((signBit << Fixed::SIGN_BIT_SHIFT) & Fixed::SIGN_BIT_ON); return result; } Waiting for your reply. Regards.. Pinus Alba wrote: Hi Sruthi, -- For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/ |
- Array Limitation. Sruthi
- Re: Array Limitation. Pinus Alba
- Re: Array Limitation. Neil Whitworth
- Re: Array Limitation. Sruthi
- Re: Array Limitation. Pinus Alba
- Re: Array Limitation. Sruthi
