Go to Post Most of all, I long to give others a chance to experience what I did with FIRST, to give people from my home town that opportunity, because FIRST really is that once in a lifetime opportunity that so many people dont get a chance to be a part of. It shouldnt be that way. - Jacqui Sutton [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
  #1   Spotlight this post!  
Unread 13-02-2008, 19:09
Nathan's Avatar
Nathan Nathan is offline
Registered User
FRC #1501 (Team T.H.R.U.S.T.)
Team Role: Alumni
 
Join Date: Sep 2006
Rookie Year: 2007
Location: United States
Posts: 149
Nathan has a spectacular aura aboutNathan has a spectacular aura aboutNathan has a spectacular aura about
How slow is floating point math really?

We currently have a couple floating point operations in our program. Is it absolutely vital that we change these? I know that I can multiply by 100 or 1000 to get rid the the decimal point, but I'd rather not for these operations.

So what do you guys think?

Thanks,
Nathan
__________________
Save money with PriceWombat, a shopping comparison and price tracking tool (that I made!).

Check out my hobby electronics business!

My former robotics team: Huntington County 4-H Robotics
  #2   Spotlight this post!  
Unread 13-02-2008, 19:32
psy_wombats's Avatar
psy_wombats psy_wombats is offline
Registered User
AKA: A. King
FRC #0467 (Duct Tape Bandits)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Shrewsbury MA
Posts: 95
psy_wombats has a spectacular aura aboutpsy_wombats has a spectacular aura aboutpsy_wombats has a spectacular aura about
Re: How slow is floating point math really?

I didn't think it was speed so much as general processor weirdness with memory. I'd multiply and remove the decimal. What exactly is preventing you from doing so? Time to execute? In that case, using floating point won't speed things up at all.

Last edited by psy_wombats : 13-02-2008 at 19:54. Reason: Speed clarification
  #3   Spotlight this post!  
Unread 13-02-2008, 19:51
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,567
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: How slow is floating point math really?

Here are some other threads with some real data:

http://www.chiefdelphi.com/forums/sh...ad.php?t=52479
http://www.chiefdelphi.com/forums/sh...ad.php?t=63159

Besides taking more time, they also use more memory, which can cause wierd errors.
  #4   Spotlight this post!  
Unread 13-02-2008, 20:53
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: How slow is floating point math really?

Quote:
Originally Posted by Nathan View Post
We currently have a couple floating point operations in our program. Is it absolutely vital that we change these?
No, a few floating point operations per 26ms cycle generally isn't a problem.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
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
Results from timing floating point operations owenhealy Programming 1 03-02-2008 01:13
Floating point math zero flippo Programming 3 09-02-2007 09:00
Floating point math in PBASIC John Gutmann Programming 2 26-12-2005 20:07
Converting floating point to integers logicalhippo Programming 3 29-01-2005 12:10
really slow........................... archiver 2001 5 24-06-2002 00:48


All times are GMT -5. The time now is 00:54.

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