From: dpvc v. a. <we...@ma...> - 2010-06-03 21:02:00
|
Log Message: ----------- Fix problem with negating mixed numbers Modified Files: -------------- pg/macros: contextFraction.pl Revision Data ------------- Index: contextFraction.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/contextFraction.pl,v retrieving revision 1.13 retrieving revision 1.14 diff -Lmacros/contextFraction.pl -Lmacros/contextFraction.pl -u -r1.13 -r1.14 --- macros/contextFraction.pl +++ macros/contextFraction.pl @@ -441,7 +441,7 @@ if ($isFraction) { $self->Error("Mixed numbers are not allowed; you must use a pure fraction") if ($self->context->flag("requirePureFractions")); - $self->{bop} = " "; + $self->{isFraction} = 1; $self->{bop} = " "; $self->{def} = $self->context->{operators}{$self->{bop}}; if ($self->{lop}->class eq 'MINUS') { # @@ -463,6 +463,15 @@ } # +# Indicate if the value is a fraction or not +# +sub class { + my $self = shift; + return "FRACTION" if $self->{isFraction}; + return $self->SUPER::class; +} + +# # Reduce the fraction # sub reduce { |