summaryrefslogtreecommitdiff
path: root/src/library/scala/math/BigDecimal.scala
Commit message (Collapse)AuthorAgeFilesLines
* Add since arg to deprecationWarning and use itSimon Ochsenreither2016-05-291-8/+8
|
* Lower-case spelling of @deprecated messagesSimon Ochsenreither2016-05-281-8/+8
|
* Extend BigDecimal with Ordered for java interopShane Delmore2016-02-011-17/+1
|
* Remove unused imports and other minor cleanupsSimon Ochsenreither2015-12-181-52/+51
| | | | | | | | | | - Language imports are preceding other imports - Deleted empty file: InlineErasure - Removed some unused private[parallel] methods in scala/collection/parallel/package.scala This removes hundreds of warnings when compiling with "-Xlint -Ywarn-dead-code -Ywarn-unused -Ywarn-unused-import".
* ScalaDoc fixes for library and library-auxJanek Bogucki2015-07-281-1/+1
|
* fix BigDecimal loosing MathContextZhong Sheng2015-05-271-2/+2
|
* Fix many typosMichał Pociecha2015-04-211-1/+1
| | | | | This commit corrects many typos found in scaladocs and comments. There's also fixed the name of a private method in ICodeCheckers.
* Fix many typos in docs and commentsmpociecha2014-12-141-1/+1
| | | | | | | | | | | | | This commit corrects many typos found in scaladocs, comments and documentation. It should reduce a bit number of PRs which fix one typo. There are no changes in the 'real' code except one corrected name of a JUnit test method and some error messages in exceptions. In the case of typos in other method or field names etc., I just skipped them. Obviously this commit doesn't fix all existing typos. I just generated in IntelliJ the list of potential typos and looked through it quickly.
* SI-8970 hashCode of BigDecimal and Double do not matchRex Kerr2014-11-211-2/+2
| | | | | | Switched isValidDouble (binary equivalence) to isDecimalDouble (decimal expansion equivalence), as people generally do not care about the slew of extra decimal digits off the end of the binary approximation to a decimal fraction (decimal equivalence is the standard now). Added minimal unit test to verify behavior.
* [backport] Fixes cut sentences in the generated scaladocsDominik Gruntz2014-08-111-3/+3
| | | | | | | | | | | | | | | | | This commit changes all first sentences of library functions which contain `i.e.` or `e.g.` and adds a `,` to prevent that the scaladoc summary sentence is cut after this abbreviation. This is possible as pull/3824 fixed how Scaladoc parses the first sentence of a method description into a sumary sentence(now the first sentence has to end with a dot followed by whitespace). Only docs in the core library are changed (src/library/**/*.scala) and only if they occur in the first sentence. Review by @heathermiller (cherry picked from commit 72721ff5dd06dea1235ecb71acae0bd61aee4814)
* Quasi-comprehensive BigDecimal soundness/correctness fix.Rex Kerr2014-01-141-70/+409
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes issues SI-6153, SI-6173, SI-6456, SI-6699, and SI-8116, along with a number of other similar possible issues. Relevant changes include * Changes to avoid heap explosion when working with BigInt - to isWhole - to hashCode - to equals - to BigInt's equals * Changes to enable equality matching hashCode - Only for sufficiently small BigInt - For identical values with different precision * Changes to isValidDouble - Takes precision into account now - New methods added to test whether even if the Double is not represented exactly, it's a representation of a certain type - New companion methods added to allow intended expansion of Double (binary/decimal difference) * Changes to constructor - Null arguments are not allowed (these can throw NPEs later at awkward/unexpected times) * New JUnit test to test all these things * Fixed existing tests to expect new behavior * Modified scaladocs to explain the issues * Deprecated problematic methods * Made application of MathContext more consistent (it is where you expect it and not where you don't) These changes are coordinated, for the most part, hence the monolithic commit.
* Removing deprecated code.Paul Phillips2013-11-181-2/+1
| | | | | Code which has been deprecated since 2.10.0 and which allowed for straightforward removal.
* fix typoxuwei-k2013-06-301-1/+1
|
* Make all numeric coercions explicit.Paul Phillips2013-05-271-3/+7
| | | | | | | | | | | | | Optimistically, this is preparation for a day when we don't let numeric types drift with the winds. Even without the optimism it's a good idea. It flushed out an undocumented change in the math package object relative to the methods being forwarded (a type is widened from what is returned in java) so I documented the intentionality of it. Managing type coercions manually is a bit tedious, no doubt, but it's not tedious enough to warrant abandoning type safety just because java did it.
* Absolutized paths involving the scala package.Paul Phillips2013-05-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Confusing, now-it-happens now-it-doesn't mysteries lurk in the darkness. When scala packages are declared like this: package scala.collection.mutable Then paths relative to scala can easily be broken via the unlucky presence of an empty (or nonempty) directory. Example: // a.scala package scala.foo class Bar { new util.Random } % scalac ./a.scala % mkdir util % scalac ./a.scala ./a.scala:4: error: type Random is not a member of package util new util.Random ^ one error found There are two ways to play defense against this: - don't use relative paths; okay sometimes, less so others - don't "opt out" of the scala package This commit mostly pursues the latter, with occasional doses of the former. I created a scratch directory containing these empty directories: actors annotation ant api asm beans cmd collection compat concurrent control convert docutil dtd duration event factory forkjoin generic hashing immutable impl include internal io logging macros man1 matching math meta model mutable nsc parallel parsing partest persistent process pull ref reflect reify remote runtime scalap scheduler script swing sys text threadpool tools transform unchecked util xml I stopped when I could compile the main src directories even with all those empties on my classpath.
* Fixed BigDecimal documentation for primitive conversion methods.Alden Torres2013-04-211-4/+4
|
* More explicit empty paren lists in method calls.Jason Zaugg2013-02-241-1/+1
|
* Merge commit 'refs/pull/1574/head' into merge-210Paul Phillips2012-11-051-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'refs/pull/1574/head': (24 commits) Fixing issue where OSGi bundles weren't getting used for distribution. Fixes example in Type.asSeenFrom Fix for SI-6600, regression with ScalaNumber. SI-6562 Fix crash with class nested in @inline method Brings copyrights in Scaladoc footer and manpage up-to-date, from 2011/12 to 2013 Brings all copyrights (in comments) up-to-date, from 2011/12 to 2013 SI-6606 Drops new icons in, replaces abstract types placeholder icons SI-6132 Revisited, cleaned-up, links fixed, spelling errors fixed, rewordings Labeling scala.reflect and scala.reflect.macros experimental in the API docs Typo-fix in scala.concurrent.Future, thanks to @pavelpavlov Remove implementation details from Position (they are still under reflection.internal). It probably needs more cleanup of the api wrt to ranges etc but let's leave it for later SI-6399 Adds API docs for Any and AnyVal Removing actors-migration from main repository so it can live on elsewhere. Fix for SI-6597, implicit case class crasher. SI-6578 Harden against synthetics being added more than once. SI-6556 no assert for surprising ctor result type Removing actors-migration from main repository so it can live on elsewhere. Fixes SI-6500 by making erasure more regular. Modification to SI-6534 patch. Fixes SI-6559 - StringContext not using passed in escape function. ... Conflicts: src/actors-migration/scala/actors/migration/StashingActor.scala src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala src/compiler/scala/tools/nsc/settings/AestheticSettings.scala src/compiler/scala/tools/nsc/transform/Erasure.scala src/library/scala/Application.scala src/library/scala/collection/immutable/GenIterable.scala.disabled src/library/scala/collection/immutable/GenMap.scala.disabled src/library/scala/collection/immutable/GenSeq.scala.disabled src/library/scala/collection/immutable/GenSet.scala.disabled src/library/scala/collection/immutable/GenTraversable.scala.disabled src/library/scala/collection/mutable/GenIterable.scala.disabled src/library/scala/collection/mutable/GenMap.scala.disabled src/library/scala/collection/mutable/GenSeq.scala.disabled src/library/scala/collection/mutable/GenSet.scala.disabled src/library/scala/collection/mutable/GenTraversable.scala.disabled src/library/scala/collection/parallel/immutable/ParNumericRange.scala.disabled
| * Brings all copyrights (in comments) up-to-date, from 2011/12 to 2013Heather Miller2012-11-021-1/+1
| |
* | SI-6388 Remove deprecated items in scala/mathSimon Ochsenreither2012-10-081-6/+0
|/
* Eliminate breaking relative names in source.Paul Phillips2012-09-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These things are killing me. Constructions like package scala.foo.bar.baz import foo.Other DO NOT WORK in general. Such files are not really in the "scala" package, because it is not declared package scala package foo.bar.baz And there is a second problem: using a relative path name means compilation will fail in the presence of a directory of the same name, e.g. % mkdir reflect % scalac src/reflect/scala/reflect/internal/util/Position.scala src/reflect/scala/reflect/internal/util/Position.scala:9: error: object ClassTag is not a member of package reflect import reflect.ClassTag ^ src/reflect/scala/reflect/internal/util/Position.scala:10: error: object base is not a member of package reflect import reflect.base.Attachments ^ As a rule, do not use relative package paths unless you have explicitly imported the path to which you think you are relative. Better yet, don't use them at all. Unfortunately they mostly work because scala variously thinks everything scala.* is in the scala package and/or because you usually aren't bootstrapping and it falls through to an existing version of the class already on the classpath. Making the paths explicit is not a complete solution - in particular, we remain enormously vulnerable to any directory or package called "scala" which isn't ours - but it greatly limts the severity of the problem.
* Adds @deprecatedInheritance to BigInt and BigDecimalSimon Ochsenreither2012-09-101-0/+1
|
* Expanded the reach of value classes.Paul Phillips2012-08-291-1/+1
| | | | | | | | | | | Now extending AnyVal: - RichInt, RichDouble, etc. - ArrayOps.ofRef, ofBoolean, etc - StringAdd - StringFormat The rest of it is the changes necessary to enable those.
* Enabling postfix ops feature warning, and working on libs to avoid them.Martin Odersky2012-04-121-1/+1
|
* Various improvements to SIP 18 diagnostics. Made scala library and compiler ↵Martin Odersky2012-04-121-0/+1
| | | | feature clean.
* SI-5627 BigInt.equals(Number) and BigDecimal.equals(Number) should implement ↵Dmitry Nadezhin2012-04-021-1/+14
| | | | equality in mathematical sense
* Update RoundingMode.Paul Phillips2012-02-011-1/+3
| | | | Not to use the deprecated Enumeration constructor.
* Migration message and version cleanupSimon Ochsenreither2011-12-071-1/+0
| | | | | | | | | | The @migration annotation can now be used like @deprecation. Old syntax is still supported, but deprecated. Improve wording and consistency of migration messages, migration warnings also print the version in which the change occurred now. Partially fixes SI-4990.
* BigDecimal adjustments.Paul Phillips2011-09-281-7/+7
| | | | | | More sensible use of MathContext, plus some BigDecimal tests. Contributed by Erik Osheim. Closes SI-4981, no review.
* Basic scaladoc for some scala.math classes.Paul Phillips2011-07-161-2/+23
| | | | | Contributed by desterkin.
* Makes BigInt's isValidThing methods make some k...Paul Phillips2011-05-051-2/+11
| | | | | | | Makes BigInt's isValidThing methods make some kind of sense. I wish I hadn't written so much code for the numerical classes which languishes in git tributaries. Closes #4540, no review.
* Adds "since" field to @deprecated.Paul Phillips2011-04-141-2/+2
| | | | | | for the patch, as it's a change I've always wanted. Moving up in the glamorous world of scala commits! No review.
* My early attempts to implement non-integral ran...Paul Phillips2011-03-231-1/+1
| | | | | | | | | | | | | | My early attempts to implement non-integral ranges in a way which was useful without having lots of floating point traps were less than successful. One of the bigger backfires is that the requirement not to round (trying, and failing anyway, to avoid surprises with methods like "contains") inflicts runtime errors. The simple way to improve this, which seems a good idea anyway, is to make the default math context something less inclined to exceptions. Default BigDecimal mc is now DECIMAL128. References #1812, #4201 and puts #4201 back to normal priority. Review by community.
* Added an innocuous java BigDecimal -> scala Big...Paul Phillips2011-03-021-53/+55
| | | | | | Added an innocuous java BigDecimal -> scala BigDecimal implicit. Cleaned up some documentation. Closes #2199, no review.
* Updated copyright notices to 2011Antonio Cunei2011-01-201-1/+1
|
* Deprecated the @serializable annotation, introd...Lukas Rytz2010-11-301-4/+2
| | | | | | | | | | | | | | | | | | | Deprecated the @serializable annotation, introduce a new trait "scala.Serializable" which has to be extended instead (cross-platform). Known issues: - Companion objects of serializable classes (including case classes) are automatically made serializable. However, they don't extend "Serializable" statically because of the known difficulty (should be done before typing, but hard). - Writing "case class C() extends Serializable" gives "error: trait Serializable is inherited twice" - Functions are serializable, but don't extend Serializable dynamically (could be fixed by making FunctionN Serializable - shouldn't we?) Note that @SerialVersionUID continues to be an annotation; it generates a static field, which is not possible otherwise in scala. Review by dragos, extempore. Question to dragos: in JavaPlatform.isMaybeBoxed, why is there a test for "JavaSerializableClass"? Is that correct?
* Cleaned up some hangover from equality struggle...Paul Phillips2010-11-151-2/+5
| | | | | | Cleaned up some hangover from equality struggles of yore. Deprecated now pointless vals. Close #3998, no review.
* Altered a bunch of places which call hashCode t...Paul Phillips2010-05-211-1/+1
| | | | | | Altered a bunch of places which call hashCode to call ## instead. No review.
* Fixed a BigDecimal/Long comparison bug reported...Paul Phillips2010-05-201-3/+4
| | | | | Fixed a BigDecimal/Long comparison bug reported on the list. No review.
* Removed deprecation. No review.Aleksandar Pokopec2010-05-181-2/+1
|
* Changed migration annotation to deprecated.Aleksandar Pokopec2010-05-181-1/+1
|
* Fixes #3445. no reviewAleksandar Pokopec2010-05-181-0/+7
|
* Removed more than 3400 svn '$Id' keywords and r...Antonio Cunei2010-05-121-1/+0
| | | | | Removed more than 3400 svn '$Id' keywords and related junk.
* Initialization ordering issue in BigDecimal.Paul Phillips2010-04-151-11/+10
| | | | | | be slipping by because -Xcheckinit doesn't work since specialization began.) No review.
* Some mopping up in equality.Paul Phillips2010-04-131-2/+4
| | | | | | way equals was being handled, and hammered it out. New ==/## tests which covers all types and values. Review by odersky.
* Fix and test case for #3169.Paul Phillips2010-03-231-2/+5
|
* A variety of bugfixes discovered by findbugs.Paul Phillips2010-01-131-1/+1
| | | | | | examples of equality comparisons which are guaranteed to return false because someone is not comparing what they think they're comparing.
* Updated copyright notices to 2010Antonio Cunei2009-12-071-1/+1
|
* Added some logic to StringLike.format so that s...Paul Phillips2009-11-251-1/+2
| | | | | | Added some logic to StringLike.format so that scala Numeric types can be used without a runtime error.
* Bringing BigInt and BigDecimal into the club of...Paul Phillips2009-11-121-4/+8
| | | | | | | | Bringing BigInt and BigDecimal into the club of things which can be equal to one another and which will have the same hashCode. Fixed some old and some new bugs associated with equality. Note: not fully optimized.