-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Breaking-Changebreaking change that may affect usersbreaking change that may affect usersIssue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Languageparser, language semanticsparser, language semantics
Description
Note: This is technically a breaking change, but arguably one that falls into Bucket 3: Unlikely Grey Area.
Summary of the new feature/enhancement
Currently and historically, an integer number literal in source code that is too big (in absolute terms) to fit into [decimal] is parsed as a [double] - this invariably leads to a loss of accuracy:
# 99999999999999999999999999999 is greater than [decimal]::MaxValue, so it is parsed as a [double]
PS> [bigint] 99999999999999999999999999999
99999999999999991433150857216Given that 7.0 introduced the n suffix to explicitly request a [bigint] and that suffixes are generally optional, with PowerShell picking the appropriate type, it would make sense to parse integer values outside the range of [decimal] as [bigint].
In other words: it would make sense to parse 99999999999999999999999999999 the same as 99999999999999999999999999999n.
vexx32, pinkfloydx33, iRon7, NicoNekoru, yecril71pl and 3 more
Metadata
Metadata
Assignees
Labels
Breaking-Changebreaking change that may affect usersbreaking change that may affect usersIssue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Languageparser, language semanticsparser, language semantics