Class FractionsKt

  • All Implemented Interfaces:

    
    public final class FractionsKt
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static Fraction fraction(Double value)
      final static Fraction fraction(Integer numerator, Integer denominator)
      final static Fraction fraction(Integer numerator)
      final static Fraction fraction(Float value)
      final static Fraction toFraction(Double $self)
      final static Fraction toFraction(Integer $self, Integer denominator)
      final static Fraction toFraction(Float $self)
      final static Fraction plus(Fraction $self, Fraction other)
      final static Fraction plus(Fraction $self, Integer other)
      final static Fraction plus(Integer $self, Fraction other)
      final static Fraction plus(Fraction $self, Float other)
      final static Fraction plus(Float $self, Fraction other)
      final static Fraction minus(Fraction $self, Fraction other)
      final static Fraction minus(Fraction $self, Integer other)
      final static Fraction minus(Integer $self, Fraction other)
      final static Fraction minus(Fraction $self, Float other)
      final static Fraction minus(Float $self, Fraction other)
      final static Fraction times(Fraction $self, Fraction other)
      final static Fraction times(Fraction $self, Integer other)
      final static Fraction times(Integer $self, Fraction other)
      final static Fraction times(Fraction $self, Float other)
      final static Fraction times(Float $self, Fraction other)
      final static Fraction div(Fraction $self, Fraction other)
      final static Fraction div(Fraction $self, Integer other)
      final static Fraction div(Integer $self, Fraction other)
      final static Fraction div(Fraction $self, Float other)
      final static Fraction div(Float $self, Fraction other)
      final static Pair<Integer, Fraction> split(Fraction $self)
      final static Integer component1(Fraction $self)
      final static Integer component2(Fraction $self)
      final static Fraction fixedFraction(Integer amount, Integer capacity, Boolean loop) 指定した引数から分数の新しいインスタンスを作成します。
      final static Fraction fixedFraction(Long amount, Long capacity)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • plus

         final static Fraction plus(Fraction $self, Fraction other)
      • plus

         final static Fraction plus(Fraction $self, Integer other)
      • plus

         final static Fraction plus(Integer $self, Fraction other)
      • plus

         final static Fraction plus(Fraction $self, Float other)
      • plus

         final static Fraction plus(Float $self, Fraction other)
      • minus

         final static Fraction minus(Fraction $self, Fraction other)
      • minus

         final static Fraction minus(Fraction $self, Integer other)
      • minus

         final static Fraction minus(Integer $self, Fraction other)
      • minus

         final static Fraction minus(Fraction $self, Float other)
      • minus

         final static Fraction minus(Float $self, Fraction other)
      • times

         final static Fraction times(Fraction $self, Fraction other)
      • times

         final static Fraction times(Fraction $self, Integer other)
      • times

         final static Fraction times(Integer $self, Fraction other)
      • times

         final static Fraction times(Fraction $self, Float other)
      • times

         final static Fraction times(Float $self, Fraction other)
      • div

         final static Fraction div(Fraction $self, Fraction other)
      • div

         final static Fraction div(Fraction $self, Integer other)
      • div

         final static Fraction div(Integer $self, Fraction other)
      • div

         final static Fraction div(Fraction $self, Float other)
      • div

         final static Fraction div(Float $self, Fraction other)
      • split

         final static Pair<Integer, Fraction> split(Fraction $self)
        Since:

        0.8.0

      • fixedFraction

         final static Fraction fixedFraction(Integer amount, Integer capacity, Boolean loop)

        指定した引数から分数の新しいインスタンスを作成します。

        Parameters:
        amount - 分子となる値
        capacity - 分母となる値
        loop - trueの場合はamountをcapacityで割った剰余を,falseの場合はcapacity以下の値を分子に使用します