On Friday 04 February 2005 18:43, Timothy Miller wrote: > > > One simplification I've already done is to not account for overflow or > > > underflow. If the exponent goes below 0 or greater than 255, it > > > wraps. Is it reasonable to just hope that no one uses numbers that > > > big or that small? > > > > Wrapping overflow is probably unproblematic, but I'm worried about underflow > > - even more so when you make 0 a really, really small number instead of > > true 0. What happens when, in the rasterizer, R, dRdY and dRdX are all 0? > > Will the adjust code in HorizontalRasterize work correctly? > > That would be an interesting scenario. You'd accumulate error in the > range of less than 2^-120. When converting that directly to integer, > it wouldn't be a problem, but if you were to multiply by a huge > number, the result could be problematic. > > I think this could be a bigger issue with coordinates at zero. > Fortunately, zero is smack between two pixel centers, so it would > never cause a rounding problem. 0.5 would never be affected by this.
I'm not sure whether my concern got across. When you say the exponent wraps for underflow and overflow, I assume this means that if the result of an operation would be 2^-129, it comes out as 2^127 or something like this. Now you say that you want to represent 0 as a very small number, let's say 2^-127. What if dRdX is 0, and adj comes out as 0.25 = 2^-2. The result of the multiplication would be 2^-129, which wraps around to 2^127 - and *that* is definitely wrong... It's that combination of incorrect underflow *and* incorrect 0 that I'm most worried about. cu, Nicolai > I have the nagging feeling that this could cause a problem somewhere > that would be noticable, but I just can't come up with a really good > example of one.
pgp4RDXk6mr7m.pgp
Description: PGP signature
_______________________________________________ Open-graphics mailing list [email protected] http://lists.duskglow.com/mailman/listinfo/open-graphics List service provided by Duskglow Consulting, LLC (www.duskglow.com)
