org.das2.datum.Ratio

Represent the ratio of two integers.

Ratio( int i )

Ratio( int n, int d )


one


zero


add

add( org.das2.datum.Ratio r ) → org.das2.datum.Ratio

Parameters

r - a Ratio

Returns:

org.das2.datum.Ratio

[search for examples] [view on GitHub] [view on old javadoc] [view source]


create

create( String s ) → org.das2.datum.Ratio

parse aaa.bbbbEcc into Ratio.

Parameters

s - a String

Returns:

an org.das2.datum.Ratio

[search for examples] [view on GitHub] [view on old javadoc] [view source]

create( double number ) → org.das2.datum.Ratio

divide

divide( org.das2.datum.Ratio r ) → org.das2.datum.Ratio

Parameters

r - a Ratio

Returns:

org.das2.datum.Ratio

[search for examples] [view on GitHub] [view on old javadoc] [view source]


doubleValue

doubleValue( ) → double

return the double value closest to this.

Returns:

the double value closest to this.

[search for examples] [view on GitHub] [view on old javadoc] [view source]


equals

equals( Object o ) → boolean

Parameters

o - an Object

Returns:

boolean

[search for examples] [view on GitHub] [view on old javadoc] [view source]


gcd

gcd( long a, long d ) → long

return the Greatest Common Divisor (GCD) of the two numbers.

Parameters

a - the first number
d - the second number, slightly more efficient if this is smaller.

Returns:

the divisor.

[search for examples] [view on GitHub] [view on old javadoc] [view source]


hashCode

hashCode( ) → int

Returns:

int

[search for examples] [view on GitHub] [view on old javadoc] [view source]


isOne

isOne( ) → boolean

Returns:

boolean

[search for examples] [view on GitHub] [view on old javadoc] [view source]


isZero

isZero( ) → boolean

Returns:

boolean

[search for examples] [view on GitHub] [view on old javadoc] [view source]


main

main( String[] args ) → void

Parameters

args - a java.lang.String[]

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


multiply

multiply( org.das2.datum.Ratio r ) → org.das2.datum.Ratio

Parameters

r - a Ratio

Returns:

org.das2.datum.Ratio

[search for examples] [view on GitHub] [view on old javadoc] [view source]


pow

pow( org.das2.datum.Ratio r ) → org.das2.datum.Ratio

Parameters

r - a Ratio

Returns:

org.das2.datum.Ratio

[search for examples] [view on GitHub] [view on old javadoc] [view source]


sqrt

sqrt( ) → org.das2.datum.Ratio

Returns:

org.das2.datum.Ratio

[search for examples] [view on GitHub] [view on old javadoc] [view source]


subtract

subtract( org.das2.datum.Ratio r ) → org.das2.datum.Ratio

Parameters

r - a Ratio

Returns:

org.das2.datum.Ratio

[search for examples] [view on GitHub] [view on old javadoc] [view source]


toString

toString( ) → String

Returns:

java.lang.String

[search for examples] [view on GitHub] [view on old javadoc] [view source]