• 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. Custom IC SKILL
  3. Simple counting with number 0.07 ?

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 143
  • Views 7281
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Simple counting with number 0.07 ?

Bertas
Bertas over 2 years ago

Hi guys, I have one question, maybe I do something wrong or I don't wake up properly today :) but I can't find an answer why this happen.

I will make it simple .... its just counting in CIW

for number 0.07

x=(0.07/(2*0.005))  => 7.0 

y=truncate(x) => 7 (integer number)

z=x-y =>  I would expect 0 but system give me 8.881784e-16

When I put any other number like like 0.09 or 0.08  .... 2.0 atc always get expected result 0

Why is that ?

Robert

  • Cancel
Parents
  • Bertas
    Bertas over 2 years ago

    Thank you guys for the explanation. I got the point. It's clear to me now. Thumbsup

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 2 years ago in reply to Bertas

    One more thing, SKILL now has the nearlyEqual function:

    x=(0.07/(2*0.005))
    7.0
    x == 7.0  ;; BAD IDEA, AS NOTED ABOVE
    => nil
    nearlyEqual(x 7)
    => t
    
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • skillUser
    skillUser over 2 years ago in reply to Bertas

    One more thing, SKILL now has the nearlyEqual function:

    x=(0.07/(2*0.005))
    7.0
    x == 7.0  ;; BAD IDEA, AS NOTED ABOVE
    => nil
    nearlyEqual(x 7)
    => t
    
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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