• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Allegro X PCB Editor
  3. Rounding of floating numbers

Stats

  • Replies 7
  • Subscribers 159
  • Views 21163
  • Members are here 0
More Content

Rounding of floating numbers

archive
archive over 17 years ago

I am comparing testpoint locations layout-to-fixture. Some Via testpoints are not on a 1 mil grid, and the round function in allegro seems to work differently than our manufacturer's fixture software round function. example; Allegro: round(145.47) - result 145 Fixture: 145.47 gets rounded to 146 If I know anything about rounding it seems that the fixture number is rounded correctly. How can I get allegro to round a number like the Fixture example?


Originally posted in cdnusers.org by Geoffm
  • Sign in to reply
  • Cancel
Parents
  • ahamlett
    ahamlett over 16 years ago

     I recently ran into this problem when doing things like:

    int(0.3 / 0.025) which should equal 12 but was returning 11 because of the IEEE floating point standard used by SKILL.

    To fix this I did added a small number that did not affect the significant digits, but forced the number to be over the actual value if the stored floating point number was less than the actual number:

    int(0.3 / 0.025 + 0.00001) which now equals 12.

     I hope this saves someone time if anyone come across this same IEEE floating point standards issue.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • ahamlett
    ahamlett over 16 years ago

     I recently ran into this problem when doing things like:

    int(0.3 / 0.025) which should equal 12 but was returning 11 because of the IEEE floating point standard used by SKILL.

    To fix this I did added a small number that did not affect the significant digits, but forced the number to be over the actual value if the stored floating point number was less than the actual number:

    int(0.3 / 0.025 + 0.00001) which now equals 12.

     I hope this saves someone time if anyone come across this same IEEE floating point standards issue.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information