Codota Logo
FractionNode
Code IndexAdd Codota to your IDE (free)

How to use
FractionNode
in
org.matheclipse.parser.client.ast

Best Java code snippets using org.matheclipse.parser.client.ast.FractionNode (Showing top 10 results out of 315)

  • Common ways to obtain FractionNode
private void myMethod () {
FractionNode f =
  • Codota IconIntegerNode numerator;IntegerNode denominator;new FractionNode(numerator, denominator)
  • Smart code suggestions by Codota
}
origin: axkr/symja_android_library

@Override
public FractionNode createFraction(final IntegerNode numerator, final IntegerNode denominator) {
  return new FractionNode(numerator, denominator);
}
origin: org.refcodes/refcodes-criteria

/**
 * Visit.
 * 
 * @param node the node
 * @return the complex
 */
@Override
public Complex visit( FractionNode node ) {
  return new Complex( node.doubleValue(), 0.0 );
}
origin: org.appdapter/ext.bundle.math.symja_jas

if (fr.isSign()) {
  return F.fraction((IInteger) convert(fr.getNumerator()), (IInteger) convert(fr.getDenominator())).negate();
return F.fraction((IInteger) convert(((FractionNode) node).getNumerator()), (IInteger) convert(((FractionNode) node)
    .getDenominator()));
origin: axkr/symja_android_library

IInteger numerator = (IInteger) convertNode(fr.getNumerator());
IInteger denominator = (IInteger) convertNode(fr.getDenominator());
if (denominator.isZero()) {
  return F.Rational(fr.isSign() ? numerator.negate() : numerator, denominator);
  return fr.isSign() ? numerator.negate() : numerator;
return F.fraction(fr.isSign() ? numerator.negate() : numerator, denominator);
origin: org.refcodes/refcodes-criteria

/**
 * {@inheritDoc} Creates a new ASTNode object.
 */
@Override
public FractionNode createFraction( final IntegerNode numerator, final IntegerNode denominator ) {
  return new FractionNode( numerator, denominator );
}
origin: org.appdapter/ext.bundle.math.symja_jas

public Complex visit(FractionNode node) {
  return new Complex(node.doubleValue(), 0.0);
}
origin: org.appdapter/ext.bundle.math.symja_jas

public FractionNode createFraction(final IntegerNode numerator, final IntegerNode denominator) {
  return new FractionNode(numerator, denominator);
}
origin: org.refcodes/refcodes-criteria

  /**
   * {@inheritDoc} Creates the function.
   */
  @Override
  public ASTNode createFunction( final IParserFactory factory, final ASTNode lhs, final ASTNode rhs ) {
    if ( rhs instanceof IntegerNode ) {
      if ( lhs instanceof IntegerNode ) {
        return new FractionNode( (IntegerNode) lhs, (IntegerNode) rhs );
      }
      return factory.createFunction( factory.createSymbol( "Times" ), lhs, new FractionNode( IntegerNode.C1, (IntegerNode) rhs ) );
    }
    return factory.createFunction( factory.createSymbol( "Times" ), lhs, factory.createFunction( factory.createSymbol( "Power" ), rhs, factory.createInteger( -1 ) ) );
  }
}
origin: org.appdapter/ext.bundle.math.symja_jas

  public ASTNode createFunction(final IParserFactory factory,
      final ASTNode lhs, final ASTNode rhs) {
    if (rhs instanceof IntegerNode) {
      if (lhs instanceof IntegerNode) {
        return new FractionNode((IntegerNode) lhs, (IntegerNode) rhs);
      }
      return factory.createFunction(factory.createSymbol("Times"), lhs,
          new FractionNode(IntegerNode.C1, (IntegerNode) rhs));
    }
    return factory.createFunction(factory.createSymbol("Times"), lhs,
        factory.createFunction(factory.createSymbol("Power"), rhs,
            factory.createInteger(-1)));
  }
}
origin: axkr/symja_android_library

  @Override
  public ASTNode createFunction(final INodeParserFactory factory, final ASTNode lhs, final ASTNode rhs) {
    if (rhs instanceof IntegerNode) {
      if (lhs instanceof IntegerNode) {
        return new FractionNode((IntegerNode) lhs, (IntegerNode) rhs);
      }
      return factory.createFunction(factory.createSymbol("Times"),
          new FractionNode(IntegerNode.C1, (IntegerNode) rhs), lhs);
    }
    if (lhs.equals(IntegerNode.C1)) {
      return factory.createFunction(factory.createSymbol("Power"), rhs, factory.createInteger(-1));
    }
    return factory.createFunction(factory.createSymbol("Times"), lhs,
        factory.createFunction(factory.createSymbol("Power"), rhs, factory.createInteger(-1)));
  }
}
org.matheclipse.parser.client.astFractionNode

Javadoc

A node for a parsed fraction string

Most used methods

  • <init>
    Instantiates a new fraction node.
  • doubleValue
    Double value.
  • getDenominator
    Gets the denominator.
  • getNumerator
    Gets the numerator.
  • isSign

Popular in Java

  • Making http post requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • addToBackStack (FragmentTransaction)
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • List (java.util)
    A List is a collection which maintains an ordering for its elements. Every element in the List has a
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registery of org.quartz
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now