Talk:Xiaolin Wu's line algorithm: Difference between revisions

→‎REXX comment: FLOOR & IPART for positive (or zero) numbers. -- ~~~~
m (→‎REXX comment: clarified comment.)
(→‎REXX comment: FLOOR & IPART for positive (or zero) numbers. -- ~~~~)
Line 61:
 
:: Ok, but I am not sure how to tell if "floor is the required definition for 'integer part'" is the right way to characterize this issue. I took my implementation and modified the draw point routine so that it adds 100 to the coordinate before rendering to the screen. This gives me a coordinate range for my algorithm which can include negative coordinates. Then, I took my original coordinate range and subtracted 100 from every value. Then, I ran the code -- I did not see any visual artifacts resulting from this set of changes. When I look at my code, I see that I used floor to implement "integer part", but I do not know if I see no visual artifacts because I "just happened to use the right definition for integer part" or whether it's because the visual effect of this issue is too small to notice. I am also wondering whether the issue might really be that the code which extracts the fractional part has to be consistent with the code that extracts the integer part. --[[User:Rdm|Rdm]] 16:34, 4 June 2012 (UTC)
 
::: Once you make all numbers non-negative, FLOOR and IPART are synonymous. It's only when using negative numbers that the issue (any difference) is raised. -- [[User:Gerard Schildberger|Gerard Schildberger]] 16:51, 4 June 2012 (UTC)
 
::: Concerning another issue: FPART. When handling negative coödinates, I was wondering if FPART is doing what it's supposed to do, but I couldn't find a good definition of FPART (with regarding to negative numbers) --- but I'm still rooting around the 'net. For non-negative numbers, the simple definition of FPART (even if wrong), still gives the correct answer. FPART of 6.78 is +0.78. But what about -8.91 ? Is the fractional part +0.91 or -0.91 ? --- I'm still trying to locate a good definition for it --- I hope the definition isn't tied (or restricted to) any particular computer language. Perhaps someone could find a complete/good definition of FPART in their appropriate language reference documentation. -- [[User:Gerard Schildberger|Gerard Schildberger]] 16:46, 4 June 2012 (UTC)