Skip to content

Conversation

ethanrushh
Copy link
Contributor

@ethanrushh ethanrushh commented Nov 15, 2024

Changes the return type of BigDecimal.Floor() from BigDecimal to BigInteger. Also implements a cast that returns the truncated BigDecimal (so same as calling Floor). This is to mimic the behaviour of other casts (e.g. float -> int, decimal -> int) that also truncate on cast.

Breaking change: Calling BigDecimal.Floor() will now return a BigIntger

Adds BigInteger explicit cast and FloorToBigInteger, and associated tests.

@ethanrushh
Copy link
Contributor Author

Changed Floor to no longer be a BigInteger, added FloorToBigInteger. Explicit cast remains the same. Updated tests and use cases where BigDecimal was being floored. No longer will be a breaking change.

@ethanrushh ethanrushh changed the title BigIntger return type for BigDecimal.Floor() and Cast BigIntger explicit cast and FloorToBigInteger for BigDecimal Nov 19, 2024
@ethanrushh ethanrushh changed the title BigIntger explicit cast and FloorToBigInteger for BigDecimal BigInteger explicit cast and FloorToBigInteger for BigDecimal Nov 19, 2024
@juanfranblanco
Copy link
Member

Many Thanks @ethanrushh

@juanfranblanco juanfranblanco merged commit e4b00d4 into Nethereum:master Nov 25, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants