www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/19/21:14:11

From: leathm AT solwarra DOT gbrmpa DOT gov DOT au (Leath Muller)
Message-Id: <199705200112.LAA18997@solwarra.gbrmpa.gov.au>
Subject: Re: float & ints & triangle3d_f
To: wapex AT silesia DOT top DOT pl (Michal)
Date: Tue, 20 May 1997 11:12:42 +1000 (EST)
Cc: djgpp AT delorie DOT com
In-Reply-To: <337EE23A.1B36@silesia.top.pl> from "Michal" at May 18, 97 01:04:26 pm

> > Is comparing floats slower then comparing ints? i.e. if (a < b)
> They are much more slower.

This is true, but if your just checking for a < b, sub a from b, store and
check the sign bit. If the sign is 0 then a <= b... If you weave the code
properly, you can do a check in about (from memory) 5 cycles... (compared
to an int's 1 though)

Leathal.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019