Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-359

Problems with numeric types (for example, 2.0D)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.0-beta-5
    • 1.0-beta-5
    • None
    • None

    Description

      1> print 2.0D
      2> go
      20D

      1> print Math.sin(2.0D)
      2> go
      20D

      1> print Math.sin(2.0D.doubleValue())
      2> go
      20D

      1> print Math.sin(2.0.doubleValue())
      2> go
      0.9092974268256817

      Another issue, but related. If BigDecimal could be automatically coerced to double, float, etc., I wouldn't have the problems above.

      1> print Math.sin(2.0)
      2> go
      No such method: sin for class: java.lang.Math with arguments: [2.0]

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rodcope Rod Cope
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: