Java Doc for FloatingPoint.java in  » Science » jscience-4.3.1 » org » jscience » mathematics » number » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Science » jscience 4.3.1 » org.jscience.mathematics.number 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.jscience.mathematics.number.FloatingPoint

FloatingPoint
final public class FloatingPoint extends Number implements Field<FloatingPoint>(Code)

This class represents a floating point number of arbitrary precision. A floating point number consists of a FloatingPoint.getSignificand significand and a decimal FloatingPoint.getExponent exponent : (significand · 10exponent).

Unlike Real numbers, no calculation error is performed on floating point instances but the number of digits used during calculations can be specified (see FloatingPoint.setDigits(int) ). The largest the number of digits, the smallest the numeric error. For example:[code] FloatingPoint two = FloatingPoint.valueOf(2); FloatingPoint.setDigits(30); // 30 digits calculations. System.out.println(two.sqrt()); > 0.141421356237309504880168872420E1 [/code]

Instances of this class are immutable and can be used to find accurate solutions to linear equations with the org.jscience.mathematics.vector.Matrix Matrix class.


author:
   Jean-Marie Dautelle
version:
   4.1, June 8, 2007
See Also:    * Wikipedia: Floating point


Field Summary
final public static  FloatingPointNaN
     The Not-a-Number instance (unique).
final public static  FloatingPointONE
     The floating point instance representing the multiplicative identity.
final static  XMLFormat<FloatingPoint>XML
     Holds the default XML representation for floating point numbers.
final public static  FloatingPointZERO
     The floating point instance representing the additive identity.


Method Summary
public  FloatingPointabs()
     Returns the absolute value of this floating point number.
public  intcompareTo(FloatingPoint that)
     Compares two floating point number numerically.
Parameters:
  that - the floating point number to compare with.
public  FloatingPointcopy()
    
public  FloatingPointdivide(FloatingPoint that)
     Returns this floating point number divided by the one specified.
Parameters:
  that - the FloatingPoint number divisor.
public  doubledoubleValue()
     Returns the value of this floating point number as a double.
public  booleanequals(Object that)
     Compares this floating point number against the specified object.
Parameters:
  that - the object to compare with.
public static  intgetDigits()
     Returns the javolution.context.LocalContext local number of digits used during calculations (default 20 digits).
public  intgetExponent()
     Returns the decimal exponent.
public  LargeIntegergetSignificand()
     Returns the significand value.
public  inthashCode()
     Returns the hash code for this floating point number.
public  FloatingPointinverse()
     Returns the inverse of this floating point number.
public  booleanisLargerThan(FloatingPoint that)
     Compares the absolute value of two FloatingPoint numbers.
Parameters:
  that - the FloatingPoint number to be compared with.
public  booleanisNaN()
     Indicates if this floating point is Not-a-Number.
public  booleanisNegative()
     Indicates if this rational number is less than zero.
public  booleanisPositive()
     Indicates if this floating point number is greater than zero.
public  booleanisZero()
     Indicates if this floating point number is equal to zero.
public  longlongValue()
     Returns the value of this floating point number as a long.
public  FloatingPointminus(FloatingPoint that)
     Returns the difference between this FloatingPoint number and the one specified.
Parameters:
  that - the floating point number to be subtracted.
public  FloatingPointopposite()
     Returns the opposite of this floating point number.
public  FloatingPointplus(FloatingPoint that)
     Returns the sum of this floating point number with the one specified.
Parameters:
  that - the floating point number to be added.
public  LargeIntegerround()
     Returns the closest integer to this floating point number.
public static  voidsetDigits(int digits)
     Sets the javolution.context.LocalContext local number of digits to be used during calculations.
public  FloatingPointsqrt()
     Returns the square root of this floating point number.
public  FloatingPointtimes(long multiplier)
     Returns the product of this floating point number with the specified long multiplier.
Parameters:
  multiplier - the long multiplier.
public  FloatingPointtimes(FloatingPoint that)
     Returns the product of this floating point number with the one specified.
Parameters:
  that - the floating point number multiplier.
public  TexttoText()
     Returns the decimal text representation of this number.
public static  FloatingPointvalueOf(LargeInteger significand, int exponent)
     Returns the floating point number for the specified LargeInteger significand and power of two exponent.
public static  FloatingPointvalueOf(long significand, int exponent)
     Returns the floating point number for the specified long significand and power of two exponent (convenience method).
public static  FloatingPointvalueOf(long longValue)
     Returns the floating point number for the specified long value (convenience method).
public static  FloatingPointvalueOf(double doubleValue)
     Returns the floating point number for the specified double value (convenience method).
public static  FloatingPointvalueOf(CharSequence chars)
     Returns the floating point number for the specified character sequence. The number of digits
Parameters:
  chars - the character sequence.

Field Detail
NaN
final public static FloatingPoint NaN(Code)
The Not-a-Number instance (unique).



ONE
final public static FloatingPoint ONE(Code)
The floating point instance representing the multiplicative identity.



XML
final static XMLFormat<FloatingPoint> XML(Code)
Holds the default XML representation for floating point numbers. This representation consists of a simple value attribute holding the FloatingPoint.toText() textual representation.



ZERO
final public static FloatingPoint ZERO(Code)
The floating point instance representing the additive identity.





Method Detail
abs
public FloatingPoint abs()(Code)
Returns the absolute value of this floating point number. |this|.



compareTo
public int compareTo(FloatingPoint that)(Code)
Compares two floating point number numerically.
Parameters:
  that - the floating point number to compare with. -1, 0 or 1 as this FloatingPoint number is numerically less than, equal to, or greater than that.



copy
public FloatingPoint copy()(Code)



divide
public FloatingPoint divide(FloatingPoint that)(Code)
Returns this floating point number divided by the one specified.
Parameters:
  that - the FloatingPoint number divisor. this / that.
throws:
  ArithmeticException - if that.equals(ZERO)



doubleValue
public double doubleValue()(Code)
Returns the value of this floating point number as a double. the numeric value represented by this FloatingPoint after conversionto type double.



equals
public boolean equals(Object that)(Code)
Compares this floating point number against the specified object.
Parameters:
  that - the object to compare with. true if the objects are the same;false otherwise.



getDigits
public static int getDigits()(Code)
Returns the javolution.context.LocalContext local number of digits used during calculations (default 20 digits). the number of digits.



getExponent
public int getExponent()(Code)
Returns the decimal exponent. this floating point decimal exponent.



getSignificand
public LargeInteger getSignificand()(Code)
Returns the significand value. this floating point significand.



hashCode
public int hashCode()(Code)
Returns the hash code for this floating point number. the hash code value.



inverse
public FloatingPoint inverse()(Code)
Returns the inverse of this floating point number. 1 / this.
throws:
  ArithmeticException - if dividend.isZero()



isLargerThan
public boolean isLargerThan(FloatingPoint that)(Code)
Compares the absolute value of two FloatingPoint numbers.
Parameters:
  that - the FloatingPoint number to be compared with. |this| > |that|



isNaN
public boolean isNaN()(Code)
Indicates if this floating point is Not-a-Number. true if this number has unbounded value;false otherwise.



isNegative
public boolean isNegative()(Code)
Indicates if this rational number is less than zero. this < 0



isPositive
public boolean isPositive()(Code)
Indicates if this floating point number is greater than zero. this > 0



isZero
public boolean isZero()(Code)
Indicates if this floating point number is equal to zero. this == 0



longValue
public long longValue()(Code)
Returns the value of this floating point number as a long. the numeric value represented by this floating point after conversion to type long.



minus
public FloatingPoint minus(FloatingPoint that)(Code)
Returns the difference between this FloatingPoint number and the one specified.
Parameters:
  that - the floating point number to be subtracted. this - that.



opposite
public FloatingPoint opposite()(Code)
Returns the opposite of this floating point number. -this.



plus
public FloatingPoint plus(FloatingPoint that)(Code)
Returns the sum of this floating point number with the one specified.
Parameters:
  that - the floating point number to be added. this + that.



round
public LargeInteger round()(Code)
Returns the closest integer to this floating point number. this floating point rounded to the nearest integer.



setDigits
public static void setDigits(int digits)(Code)
Sets the javolution.context.LocalContext local number of digits to be used during calculations.
Parameters:
  digits - the number of digits.
throws:
  IllegalArgumentException - if digits <= 0



sqrt
public FloatingPoint sqrt()(Code)
Returns the square root of this floating point number. the positive square root of this floating point number.



times
public FloatingPoint times(long multiplier)(Code)
Returns the product of this floating point number with the specified long multiplier.
Parameters:
  multiplier - the long multiplier. this · multiplier.



times
public FloatingPoint times(FloatingPoint that)(Code)
Returns the product of this floating point number with the one specified.
Parameters:
  that - the floating point number multiplier. this · that.



toText
public Text toText()(Code)
Returns the decimal text representation of this number. the text representation of this number.



valueOf
public static FloatingPoint valueOf(LargeInteger significand, int exponent)(Code)
Returns the floating point number for the specified LargeInteger significand and power of two exponent.
Parameters:
  significand - the significand value.
Parameters:
  exponent - the power of two exponent. (significand · 2exponent



valueOf
public static FloatingPoint valueOf(long significand, int exponent)(Code)
Returns the floating point number for the specified long significand and power of two exponent (convenience method).
Parameters:
  significand - the significand value.
Parameters:
  exponent - the power of two exponent. (significand · 2exponent



valueOf
public static FloatingPoint valueOf(long longValue)(Code)
Returns the floating point number for the specified long value (convenience method).
Parameters:
  longValue - the long value. FloatingPoint.valueOf(longValue, 0)



valueOf
public static FloatingPoint valueOf(double doubleValue)(Code)
Returns the floating point number for the specified double value (convenience method).
Parameters:
  doubleValue - the double value. FloatingPoint.valueOf(longValue, 0)



valueOf
public static FloatingPoint valueOf(CharSequence chars)(Code)
Returns the floating point number for the specified character sequence. The number of digits
Parameters:
  chars - the character sequence. the corresponding FloatingPoint number.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.