News for hackers. Stuff that matters.
Re:Copilot sells code other people wrote by zzo38computer on Thursday June 23, 2022 @05:53PM (#31855595)
I also implemented this algorithm in MMIX:

   % Constants
  FISRCON GREG #5FE6EB50C7B537A9
  THREHAF GREG #3FF8000000000000
   % Save half of the original number
   OR $2,$0,0
   INCH $2,#FFF0
   % Bit level hacking
   SRU $1,$0,1
   SUBU $0,FISRCON,$1
   % First iteration
   FMUL $1,$2,$0
   FMUL $1,$1,$0
   FSUB $1,THREHAF,$1
   FMUL $0,$0,$1
   % Second iteration
   FMUL $1,$2,$0
   FMUL $1,$1,$0
   FSUB $1,THREHAF,$1
   FMUL $0,$0,$1
(Note this assumes that the input number is not too small; if it is, then it will not be possible to compute half by this algorithm. Also, like with the original code, the second iteration may be omitted if desired.)

(This comment and the MMIX code it contains, and all other comments that I wrote on here, are I agree release it to public domain.)

There are no comments on this comment yet.