Skip to content

Commit

Permalink
Merge pull request openwebwork#308 from dpvc/fraction-fix
Browse files Browse the repository at this point in the history
Add differentiation to fractions, and add cmp_defaults
  • Loading branch information
mgage authored Jul 7, 2017
2 parents 8f22d5f + a4a6bcc commit 2da8143
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions macros/contextFraction.pl
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,8 @@ sub reduce {
package context::Fraction::Real;
our @ISA = ('Value::Real');

sub cmp_defaults {Value::Real::cmp_defaults(@_)}

#
# Allow Real to convert Fractions to Reals
#
Expand Down Expand Up @@ -831,6 +833,16 @@ sub atan2 {
return $self->inherit($other)->make(CORE::atan2($l->eval,$r->eval));
}

##################################################
#
# Differentiation
#

sub D {
my $self = shift;
return $self->make(0,1);
}

##################################################
#
# Utility
Expand Down

0 comments on commit 2da8143

Please sign in to comment.