apple / swift-numerics

Advanced mathematical types and functions for Swift

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Warnings in `Double.testIntegerExponent()`

benrimmington opened this issue · comments

https://github.com/apple/swift-numerics/blob/1.0.2/Tests/RealTests/IntegerExponentTests.swift#L160-L163

RealTests/IntegerExponentTests.swift:160:18: warning: '1.7976931348623159721893102860411089e308' overflows to inf because its magnitude exceeds the limits of a float literal
    assertClose( 1.7976931348623159721893102860411089e308, Double.pow(-u, 3196577161300664270), allowedError: tol)
                 ^

RealTests/IntegerExponentTests.swift:162:17: warning: '-1.7976931348623159071387553670790721e308' overflows to -inf because its magnitude exceeds the limits of a float literal
    assertClose(-1.7976931348623159071387553670790721e308, Double.pow(-d, -6393154322601327475), allowedError: tol)
                ^

RealTests/IntegerExponentTests.swift:163:18: warning: '1.7976931348623161067227863205510754e308' overflows to inf because its magnitude exceeds the limits of a float literal
    assertClose( 1.7976931348623161067227863205510754e308, Double.pow(-d, -6393154322601327476), allowedError: tol)
                 ^

Environment:

  • Swift 5.7.2 (arm64)
  • Xcode 14.2 (arm64)
  • macOS 13.1 (arm64)

These are expected; the literal will round to infinity as desired.