View unanswered posts | View active topics It is currently Wed Sep 23, 2020 4:06 pm






Reply to topic  [ 3 posts ] 
float representation 
Author Message
Rookie

Joined: Wed Feb 24, 2010 2:02 pm
Posts: 2
Post float representation
Hi,

I was trying to implement the following equation in the C style syntex, but the compiler is generating following error message:

" **Error**:Expected->';'. Found 'e' "

float X1 = 2.01,X2 = 0.0039,X3;
X3 = 0.992332593447530331e0 * X1 - 0.420566662292053400e-2 * X2

Is there a way-around to type the floating point variables using the above mentioned syntex?

Regards,

N.B.:
I want to insert the equtions using the above mentioned syntex because there are alot of equations which are being generated by a code generator. Its very tedious to manualy edit them for different test run.


Wed Feb 24, 2010 2:16 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: float representation
Hi Ahmad,

Quote:
Is there a way-around to type the floating point variables using the above mentioned syntex?

I want to insert the equtions using the above mentioned syntex because there are alot of equations which are being generated by a code generator. Its very tedious to manualy edit them for different test run.

In short: no. Also, I am not sure the floats in ROBOTC are as precise as you write them down. They are single precision only, afaik.

- Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Wed Feb 24, 2010 2:23 pm
Profile WWW
Rookie

Joined: Wed Feb 24, 2010 2:02 pm
Posts: 2
Post Re: float representation
Hmm, I See, could you suggeste any utility to convert following equation into non scientific format?

Yt[0] = 0.707110000000000016e0 * X1 - 0.707110000000000016e0 * X2 + 0.229932000000000016e2 * X3 + 0.247388300000000002e2 * X4 - 0.234700000000000014e-1 * X5 + 0.227186000000000022e1 * X6;

Yt[1] = 0.707110000000000016e0 * X1 + 0.707110000000000016e0 * X2 + 0.229932000000000016e2 * X3 + 0.247388300000000002e2 * X4 + 0.234700000000000014e-1 * X5 + 0.227186000000000022e1 * X6;

Regards


Thu Feb 25, 2010 8:06 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.