…  
…  
64  
64  
65  
65  
66  
66  
67  
67  
68  =head3 cplx_cmp 
68  =head3 cplx_cmp 
69  
69  
70  # This subroutine compares complex numbers. 
70  # This subroutine compares complex numbers. 
71  # Available prefilters include: 
71  # Available prefilters include: 
72  # each of these are called by cplx_cmp( answer, mode => '(prefilter name)' ) 
72  # each of these are called by cplx_cmp( answer, mode => '(prefilter name)' ) 
73  # 'std' The standard comparison method for complex numbers. This option it the default 
73  # 'std' The standard comparison method for complex numbers. This option it the default 
74  # and works with any combination of cartesian numbers, polar numbers, and 
74  # and works with any combination of cartesian numbers, polar numbers, and 
…  
…  
84  # 'strict_num_polar' This prefilter allows only complex numbers of the form "ae^(bi)" where a and b 
84  # 'strict_num_polar' This prefilter allows only complex numbers of the form "ae^(bi)" where a and b 
85  # are strictly numbers. 
85  # are strictly numbers. 
86  # 'strict' This is a combination of strict_num_cartesian and strict_num_polar, so it 
86  # 'strict' This is a combination of strict_num_cartesian and strict_num_polar, so it 
87  # allows complex numbers of either the form "a+bi" or "ae^(bi)" where a and b 
87  # allows complex numbers of either the form "a+bi" or "ae^(bi)" where a and b 
88  # are strictly numbers. 
88  # are strictly numbers. 
89  


90  
89  
91  =cut 
90  =cut 
92  
91  
93  sub cplx_cmp { 
92  sub cplx_cmp { 
94  my $correctAnswer = shift; 
93  my $correctAnswer = shift; 
…  
…  
374  } 
373  } 
375  } 
374  } 
376  
375  
377  =head2 Utility functions 
376  =head2 Utility functions 
378  
377  
379  # for checking the form of a number or of the C<student_ans> field in an answer hash 
378  # for checking the form of a number or of the <student_ans> field in an answer hash 
380  
379  
381  =cut 
380  =cut 
382  
381  
383  
382  
384  # Output is text displaying the complex numver in "e to the i theta" form. The 
383  # Output is text displaying the complex numver in "e to the i theta" form. The 