Go to Post The size, speed, and power of full sized FRC robots are much more sublime. People go to the zoo to see the lions and tigers, not the ants. - Jared Russell [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread 23-01-2004, 09:33
Unsung FIRST Hero
Mike Betts Mike Betts is offline
Electrical Engineer
no team
Team Role: Engineer
 
Join Date: Dec 2001
Rookie Year: 1995
Location: Homosassa, FL
Posts: 1,442
Mike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond repute
Re: Needing A header file

Quote:
Originally Posted by jweric
the reason why I must use a float point is because I need to have correct values, saddly I cant do it any other way.
That is incorrect, you just are not aware of another way. Use fixed-point integer notation.

An example variable declaration could be:

integer max_v; // 2FX12 (0x1000 = 1 foot/sec)

In the above example, the resolution of the variable for maximum velocity is
0.003 inches per second and the variable ranges from + +7.99975 to -7.99975 feet per second.

Choose your number system with care and beware of overflowing variables in your calculations. Also realize that 0x8000 (negative zero) is not a number!

I assure you that the 2004 Bobcat has no floating-point variables and, sensor accuracy notwithstanding, the mathematical accuracy of our position is less than a tenth of an inch.

Best of luck,
__________________
Mike Betts

Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013

As easy as 355/113...

Last edited by Mike Betts : 23-01-2004 at 13:19.
  #17   Spotlight this post!  
Unread 23-01-2004, 09:49
Jared Stofflett Jared Stofflett is offline
Registered User
#0123
 
Join Date: Nov 2003
Location: Hamtramck
Posts: 10
Jared Stofflett is an unknown quantity at this point
Send a message via AIM to Jared Stofflett
Re: Needing A header file

Can you give me a tutorial or example where I can learn more about this? ALl i've learned so far for decimal points is floating point data types. APpreciate any info.
  #18   Spotlight this post!  
Unread 23-01-2004, 09:59
Unsung FIRST Hero
Mike Betts Mike Betts is offline
Electrical Engineer
no team
Team Role: Engineer
 
Join Date: Dec 2001
Rookie Year: 1995
Location: Homosassa, FL
Posts: 1,442
Mike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond repute
Re: Needing A header file

Quote:
Originally Posted by Jared Stofflett
Can you give me a tutorial or example where I can learn more about this? ALl i've learned so far for decimal points is floating point data types. APpreciate any info.
Jared,

Unfortunately, everything I have is in books. You might try to google it.
__________________
Mike Betts

Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013

As easy as 355/113...
  #19   Spotlight this post!  
Unread 23-01-2004, 10:00
Guest
 
Posts: n/a
Floating Point Tutorial

Quote:
Originally Posted by Jared Stofflett
Can you give me a tutorial or example where I can learn more about this? ALl i've learned so far for decimal points is floating point data types. APpreciate any info.
Did a Yahoo search and got for "floating point" and got this tutorial web address: http://www.cs.utah.edu/~zachary/isp/applets/FP/FP.html

Most important thing about floating point:
DO NOT use unless absolutely neccessary. Any computation with floating-point data (like floats or doubles) is much slower than the same operation with integers (like chars, ints, and longs).
Floating-point data is different than other data because the number that the data itself represents is not directly stored. Instead, a mantissa, sign, and exponent are stored. This is sort of like scientific notation where you know the exponent which for the base 10 and the multiplier. In floating-point, you store every number as:
[sign] [mantissa] x 2 ^ ([exponent])
The 2 is not stored because it is the same for every number. Sign is 0 if the number is positive, and 1 if the number is negative (only one bit stored). Exponents must account for both negative and positive exponents, hence the exponent has a bias. This means that a positive number is added to all exponents in order to make every possible exponent positive.


Hope this helps!
  #20   Spotlight this post!  
Unread 23-01-2004, 10:25
Unsung FIRST Hero
Mike Betts Mike Betts is offline
Electrical Engineer
no team
Team Role: Engineer
 
Join Date: Dec 2001
Rookie Year: 1995
Location: Homosassa, FL
Posts: 1,442
Mike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond repute
Re: Needing A header file

Quote:
Originally Posted by Jared Stofflett
Can you give me a tutorial or example where I can learn more about this? ALl i've learned so far for decimal points is floating point data types. APpreciate any info.
Did a quick google and found this: http://www.embedded.com/98/9804fe2.htm

It should get you started...
__________________
Mike Betts

Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013

As easy as 355/113...
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
First Logo as a CAD file jrgrim12 Inventor 4 14-02-2003 11:42
The need for File Maker Pro 5 Dev. Edition archiver 2000 1 23-06-2002 22:50
Dashv2.ocx dependency file now available archiver 2000 0 23-06-2002 22:00
Improving PBASIC: Request for Comments Greg Ross Programming 19 16-02-2002 22:14


All times are GMT -5. The time now is 15:34.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi