Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arithmetic overflow (Overflow error) #25

Open
perfecto25 opened this issue Nov 22, 2024 · 0 comments
Open

Arithmetic overflow (Overflow error) #25

perfecto25 opened this issue Nov 22, 2024 · 0 comments

Comments

@perfecto25
Copy link

trying to get memory percent

require "hardware"

module Caju::Memory
  extend self 

  def get_mem()
    mem = Hardware::Memory.new
    return mem.used.to_i
  end
  
  def get_mem_pct()
    mem = Hardware::Memory.new
    return mem.percent.to_i
  end

end # module
Unhandled exception: Arithmetic overflow (OverflowError)
  from lib/hardware/src/memory.cr:64:36 in 'percent'
  from src/memory.cr:13:12 in 'get_mem_pct'
  from src/caju.cr:29:20 in '__crystal_main'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant