-
Notifications
You must be signed in to change notification settings - Fork 327
Use Rounding_Mode
instead of use_bankers
flag
#12641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
d89e808
all but doc
GregoryTravis 64127a6
wip
GregoryTravis 57ee98d
add import to Numbers
GregoryTravis 07e91da
wip
GregoryTravis e5cfcbe
Merge branch 'develop' into wip/gmt/9387-rm
GregoryTravis 0939c5d
Merge branch 'develop' into wip/gmt/9387-rm
GregoryTravis 974e859
added rm import
GregoryTravis ae33956
Merge branch 'develop' into wip/gmt/9387-rm
GregoryTravis e246663
typo
GregoryTravis 859cca2
Merge branch 'develop' into wip/gmt/9387-rm
GregoryTravis d74c53b
wip
GregoryTravis 0c36aa9
proper constructors
GregoryTravis 168b76f
api
GregoryTravis 24778cb
typo
GregoryTravis 2557fef
Merge branch 'develop' into wip/gmt/9387-rm
GregoryTravis 0e91142
wip
GregoryTravis 4e4e0fc
Merge branch 'develop' into wip/gmt/9387-rm
GregoryTravis 29dc9f1
fix
GregoryTravis 5c8b8ab
changelog
GregoryTravis 7fd7664
fmt
GregoryTravis 5be63fe
wip
GregoryTravis 832af0c
Merge branch 'develop' into wip/gmt/9387-rm
GregoryTravis 90b425d
clarified changelog
GregoryTravis d80aa84
wip
GregoryTravis 3f2ebc6
Merge branch 'develop' into wip/gmt/9387-rm
GregoryTravis 627cab1
handle deprecated argument in Numbers
GregoryTravis df9486d
decimal, columns
GregoryTravis 5e113ab
Merge branch 'develop' into wip/gmt/9387-rm
GregoryTravis 3837536
api
GregoryTravis 2b5b406
mark db deprecated warning spec pending
GregoryTravis b6a18df
api
GregoryTravis 9808e51
Use conversion instead of method.
jdunkerley 5bcab3d
Merge branch 'develop' into wip/gmt/9387-rm
GregoryTravis fdf7814
submodule update
GregoryTravis b08e419
merge
GregoryTravis 15e5a47
Merge branch 'develop' into wip/gmt/9387-rm
GregoryTravis e5c354e
api
GregoryTravis afc577f
removed more Bools
GregoryTravis 2637e4d
submodule update
GregoryTravis 5fbbe9c
disable converison
GregoryTravis 6e700ab
Revert "disable converison"
GregoryTravis 3ae9f3b
Merge branch 'develop' into wip/gmt/9387-rm
GregoryTravis c356b6a
log
GregoryTravis 316c892
removed self-import
GregoryTravis 246689b
unused import
GregoryTravis 4090a0a
review, logging
GregoryTravis b3087a9
api
GregoryTravis c1bcc1d
unused warnings
GregoryTravis 6e3f45e
remove logging
GregoryTravis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
distribution/lib/Standard/Base/0.0.0-dev/docs/api/Data/Numeric/Rounding_Mode.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
## Enso Signatures 1.0 | ||
## module Standard.Base.Data.Numeric.Rounding_Mode | ||
- type Rounding_Mode | ||
- Value rounding_mode:Standard.Base.Data.Numeric.Rounding_Mode.RoundingMode | ||
- bankers -> Standard.Base.Any.Any | ||
- half_up -> Standard.Base.Any.Any | ||
- Bankers | ||
- Half_Up | ||
- Standard.Base.Data.Numeric.Rounding_Mode.Rounding_Mode.from that:Standard.Base.Data.Boolean.Boolean -> Standard.Base.Data.Numeric.Rounding_Mode.Rounding_Mode |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
from Standard.Base import all | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
import project.Errors.Deprecated.Deprecated | ||
|
||
polyglot java import java.math.RoundingMode | ||
|
||
## A wrapper around the Java | ||
|
@@ -7,17 +10,24 @@ polyglot java import java.math.RoundingMode | |
`Rounding_Mode` is used to specify the method to use for rounding a value in | ||
operations on `Decimal`s.` See `Decimal` for more details. | ||
type Rounding_Mode | ||
## PRIVATE | ||
Value (rounding_mode : RoundingMode) | ||
|
||
## ICON math | ||
Round towards positive infinity for positive numbers, and negative | ||
infinity for negative numbers. (This is the default.) | ||
half_up : Rounding_Mode | ||
half_up = Rounding_Mode.Value RoundingMode.HALF_UP | ||
Half_Up | ||
|
||
## ICON math | ||
Rownd towards the nearest neighbor, with ties broken by rounding towards | ||
the nearest even neighbor. | ||
bankers : Rounding_Mode | ||
bankers = Rounding_Mode.Value RoundingMode.HALF_EVEN | ||
Bankers | ||
|
||
private to_java_rounding_mode self -> RoundingMode = | ||
case self of | ||
Rounding_Mode.Half_Up -> RoundingMode.HALF_UP | ||
Rounding_Mode.Bankers -> RoundingMode.HALF_EVEN | ||
|
||
## PRIVATE | ||
Convert deprecated `use_bankers : Boolean` arguments (passed as | ||
`rounding_mode`) to `Rounding_Mode`. | ||
Rounding_Mode.from (that:Boolean) = | ||
rounding_mode_resolved = if that then Rounding_Mode.Bankers else Rounding_Mode.Half_Up | ||
Warning.attach (Deprecated.Warning "Standard.Base.Data.Numeric" "Rounding_Mode" "use_bankers:Boolean is deprecated, use Rounding_Mode instead") rounding_mode_resolved |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we indicate that this is a potentially breaking change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NetBeans has infrastructure for marking a change as incompatible and then rendering it as highlighted and/or in a special section: https://bits.netbeans.org/10.0/javadoc/org-openide-modules/apichanges.html