home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   sci.math.symbolic      Symbolic algebra discussion      10,432 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 9,210 of 10,432   
   Rosario19 to All   
   Re: Is it an Axiom bug?   
   14 Nov 16 20:55:48   
   
   From: Ros@invalid.invalid   
      
   On Mon, 14 Nov 2016 18:06:17 +0100, Rosario19 wrote:   
   >why h and v functions differ for the same input   
   >and why h() function the one has the correct result say something   
   >about "true operation"?   
   >   
   >h(y:POLY INT):Boolean==   
   > local c   
   > c:=factors(y); r:= #c   
   > output [r,c]   
   > if     (r=1)::Boolean and c.1.exponent<2     then r:=true   
   > else if(r=2)::Boolean and ground?(c.1.factor)then r:=true   
   > else r:=false   
   > r   
   >   
   >   Function declaration h : Polynomial Integer -> Boolean has been   
   >      added to workspace.   
   >   
   >Type: Void   
   >   
   >v(y:POLY INT):Boolean==   
   > local c,q   
   > c:=factors(y); q:= #c   
   > output [q,c]   
   > if     (q=1)::Boolean and c.1.exponent<2     then r:=true   
   > else if(q=2)::Boolean and ground?(c.1.factor)then r:=true   
   > else r:=false   
   > r   
      
   in the book factors is used in a different way and only for   
   integers...   
      
   v(y:POLY INT):Boolean==   
    local c,q   
    c:=factors(factor(y)); q:= #c; r:Boolean:=false   
   -- output [q,c]   
    if     (q=1)::Boolean and c.1.exponent<2     then r:=true   
    else if(q=2)::Boolean and ground?(c.1.factor)then r:=true   
    r   
      
   this for me is ok   
      
   it would find if a POLY element (with integers coefficients) of   
   degree>=1 is prime [in the polynomy with integers coefficients]   
      
   for example x^2 is factorizable in x*x   false   
   x^2-1 is     factorizable in (x-1)*(x+1) false   
   x     is not factorizable                true   
   x-1   is not factorizable                true   
   x^2+1 is not factorizable                true   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca